phone_parse() extracts the country calling code, national significant
number, extension, region, validity, number type and E.164 representation for
each element of a character vector.
Value
A data frame of class c("dialtone_phone", "data.frame") with one
row per element of x and the columns:
country_code: integer country calling code (e.g.1L,44L,91L), orNA_integer_.national_number: character national significant number (preserving any significant leading zeros, as in Italian fixed-line numbers), orNA_character_.extension: character extension digits if present, orNA_character_.region: two-letter region code (or"001"for non-geographic numbers), orNA_character_.possible: logical;TRUEif the length is possible for the calling code,FALSEotherwise, andNAwherexisNA.valid: logical;TRUEif the number matches a valid numbering-plan pattern,FALSEotherwise, andNAwherexisNA.type: character number type (seephone_type()), orNA_character_.e164: character E.164 formatted number (+<country_code><national_number>), orNA_character_.
Examples
phone_parse(c("+1 650-253-0000", "020 7946 0192", "not a number", NA), region = "GB")
#> country_code national_number extension region possible valid
#> 1 1 6502530000 <NA> US TRUE TRUE
#> 2 44 2079460192 <NA> GB TRUE TRUE
#> 3 NA <NA> <NA> <NA> FALSE FALSE
#> 4 NA <NA> <NA> <NA> NA NA
#> type e164
#> 1 fixed_line_or_mobile +16502530000
#> 2 fixed_line +442079460192
#> 3 <NA> <NA>
#> 4 <NA> <NA>