Skip to contents

Is it a US / NANP phone number?

Usage

is_phone(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for common US formats such as 510-577-3201, (309) 647-1820, 1-650-384-9911, 650 231 1123.

See also

Other phone detectors: is_intl_phone(), is_msisdn()

Examples

is_phone(c("(309) 647-1820", "510-577-3201", "12345", NA))
#> [1]  TRUE  TRUE FALSE    NA