dialr-valid {dialr}R Documentation

Phone number validity checks

Description

For each element of x:

Usage

is_parsed(x)

is_valid(x)

is_possible(x, detailed = FALSE, type = NULL)

Arguments

x

A phone vector.

detailed

If FALSE, is_possible returns a logical vector. If TRUE, it returns a character vector with "IS_POSSIBLE" or the reason for failure. See Details section for possible return values.

type

If provided, checks if x is possible for the given phone number type.

Details

Possible return values for is_possible(x, detailed = TRUE):

libphonenumber reference

is_valid(): PhoneNumberUtil.isValidNumber()

is_possible(): PhoneNumberUtil.isPossibleNumber()

is_possible(detailed = TRUE): PhoneNumberUtil.isPossibleNumberWithReason()

is_possible(type = type): PhoneNumberUtil.isPossibleNumberForType()

is_possible(detailed = TRUE, type = type): PhoneNumberUtil.sPossibleNumberForTypeWthReason()

See Also

Other phone functions: dialr-example, dialr-match, dialr-phone, dialr-region, dialr-type, dialr

Examples

  x <- phone(c(0, 0123, "0412 345 678", "61412987654", "03 9123 4567", "+12015550123"), "AU")

  is_parsed(x)
  is_valid(x)

  is_possible(x)
  is_possible(x, detailed = TRUE)

  is_possible(x, type = "MOBILE")
  is_possible(x, detailed = TRUE, type = "MOBILE")

[Package dialr version 0.4.2 Index]