Package 'dialrs'

Title: Parse phone numbers
Description: Parse phone numbers using the Rust crate 'phonenumber'. Includes validation of numbers and formatting.
Authors: David Schoch [aut, cre]
Maintainer: David Schoch <[email protected]>
License: Apache License (== 2)
Version: 0.0.1.9000
Built: 2024-11-04 05:49:38 UTC
Source: https://github.com/schochastics/dialrs

Help Index


dialrs: Parse phone numbers

Description

logo

Parse phone numbers using the Rust crate 'phonenumber'. Includes validation of numbers and formatting.

Author(s)

Maintainer: David Schoch [email protected] (ORCID)

See Also

Useful links:


A set of fake phone numbers for testing

Description

A set of fake phone numbers for testing

Usage

fake_phone

Format

An object of class character of length 100.


Extract country code from phone numbers

Description

Extract country code from phone numbers

Usage

phone_country_code(phone)

Arguments

phone

character vector of phone numbers

Value

integer vector of country codes phone_country_code("+4916012345678")


Print Rust internal phonenumber for debugging purposes

Description

Print Rust internal phonenumber for debugging purposes

Usage

phone_debug_print(input, country)

Arguments

input

character. a phone number to parse

country

character. CLDR code

Value

nothing just used for side effects


Check if strings are valid phone numbers

Description

Check if strings are valid phone numbers

Usage

phone_is_valid(phone, country = "")

Arguments

phone

character vector of phone numbers

country

CLDR country code. If empty, tries to parse it from phone

Value

TRUE if valid phone number, FALSE otherwise

Examples

phone_is_valid(fake_phone)

Parse phone numbers into specific format

Description

Parse phone numbers into specific format

Usage

phone_parse(phone, country = "", format)

Arguments

phone

character vector of phone numbers

country

CLDR country code. If empty, tries to parse it from phone

format

character. one of "International", "National", "RFC3966", "E.164"

Value

character vector of parsed and formatted phone numbers phone_parse(fake_phone,format = "RFC3966") phone_parse("016012345678",country = "DE",format = "International")


Return type of phone number

Description

Return type of phone number

Usage

phone_type(phone, country = "")

Arguments

phone

character vector of phone numbers

country

CLDR country code. If empty, tries to parse it from phone

Value

character vector of phone number types

Examples

phone_type(fake_phone)