# Create a phone vector
x <- phone(c(0, 0123, "0412 345 678", "61412987654", "03 9123 4567", "+12015550123"), "AU")
is.phone(x)
print(x)
as.character(x)
format(x)
format(x, home = "AU")
# Parse international number with no default region
phone("+61412345678", NA)
# Will fail to parse if number is not in international format
phone("0412345678", NA)
# A combination can be used
phone(c("+61412345678", "0412345678"), c(NA, "AU"))
Run the code above in your browser using DataLab