get_timezone {dialr} | R Documentation |
Phone number time zone
Description
Retrieve a list of CLDR time zones to which a phone number belongs.
Usage
get_timezone(
x,
strict = FALSE,
show_progress = getOption("dialr.show_progress")
)
Arguments
x |
A phone vector. |
strict |
Should invalid phone numbers be removed? If |
show_progress |
Should a progress bar be displayed? Defaults to the
option |
Details
This function assumes the phone number is geo-localizable. Fixed-line and mobile numbers are considered possible candidates for geo-localization.
Value
A character vector of time zones to which each phone number belongs,
separated by ;
, or the default unknown time zone "Etc/Unknown"
if no
other time zone was found.
libphonenumber reference
get_timezone()
:
PhoneNumberToTimeZonesMapper.getTimeZonesForGeographicalNumber()
.
Examples
x <- phone(c(0, 0123, "0412 345 678", "61412987654", "03 9123 4567", "+12015550123"), "AU")
get_timezone(x)
get_timezone(x, strict = TRUE)
# Return a list
strsplit(get_timezone(x), ";")
[Package dialr version 0.4.2 Index]