Learn R Programming

charlatan (version 0.2.2)

InternetProvider: InternetProvider

Description

InternetProvider

Usage

internet_provider_locales

Arguments

locale

(character) the locale to use. Run internet_provider_locales() for locales supported (default: en_US)

Format

An object of class character of length 8.

Details

Methods

  • to_ascii(x) - convert to ascii

  • email(domain) - get an email address

  • safe_email() - get a safe email address

  • free_email() - free email address

  • company_email() - company email address

  • ascii_email() - ascii email address

  • ascii_safe_email() - safe ascii email address

  • ascii_free_email() - an ascii free email address

  • ascii_company_email() - ascii company email address

  • user_name() - a user name

  • tld() - a tld

  • free_email_domain() - free email domain

  • url(schemes) - get a url

  • domain_name(levels) - get a domain name

  • domain_word() - get a domain word

  • ipv4() - get a random ipv4 address

  • mac_address() - get a mac address

  • uri_page() - get a uri page

  • uri_path() - get a uri path

  • uri_extension() - get a uri extension

  • image_url(width, height) - get an image url

Examples

Run this code
# NOT RUN {
(x <- InternetProvider$new())
x$locale

# uri/url/tld/etc.
x$tld()
x$domain_word()
x$domain_name()
x$domain_name(levels = 2)
x$domain_name(levels = 3)
x$domain_name(levels = 10)
## url's
x$url()
x$url(schemes = c('hbbp', 'hggp'))
x$image_url()
## uri's
x$uri()
x$uri_page()
x$uri_extension()
x$uri_path()
x$uri_path(deep = 1)
x$uri_path(deep = 2)
x$uri_path(deep = 3)
x$uri_path(deep = 4)

# user name
x$user_name()

# emails
x$email()
x$safe_email()
x$free_email()
x$company_email()
x$free_email_domain()
x$ascii_email()
x$ascii_safe_email()
x$ascii_free_email()
x$ascii_company_email()

# addresses, mac, ipv4
x$mac_address()
if (requireNamespace("iptools", quietly=TRUE)) {
  x$ipv4()
}

# different locales
(x <- InternetProvider$new(locale = "en_AU"))
x$locale
x$tld()
x$email()
x$free_email_domain()

(x <- InternetProvider$new(locale = "de_DE"))
x$locale
x$tld()
x$uri()
x$email()
x$ascii_email()

(x <- InternetProvider$new(locale = "bg_BG"))
x$locale
x$tld()
x$uri()
x$url()
x$user_name()
x$email()
x$ascii_email()

(x <- InternetProvider$new(locale = "cs_CZ"))
x$url()
x$user_name()
x$email()

(x <- InternetProvider$new(locale = "fa_IR"))
x$url()

(x <- InternetProvider$new(locale = "fr_FR"))
x$url()
x$user_name()
x$email()

(x <- InternetProvider$new(locale = "hr_HR"))
x$url()
x$user_name()
x$email()

# convert a string to ascii with stringi pkg
if (requireNamespace("stringi", quietly=TRUE)) {
  x$to_ascii("an<U+00EF>")
}
# }

Run the code above in your browser using DataLab