เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Hunting for phone numbers

For your first task you are going to pull out the phone numbers from this vector of contact information:

contact

You'll assume the phone numbers you are looking for follow the American standard of a three digit area code, a three digit exchange and then a four digit number, but each part could be separated by spaces or various punctuation symbols.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

String Manipulation with stringr in R

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Create a three digit pattern
three_digits <- ___

# Test it
str_view_all(contact, pattern = three_digits)
แก้ไขและรันโค้ด