Learn R Programming

randNames (version 0.2.3)

rand_names: Random name generator

Description

This function grabs a list of random names from the random user generator

Usage

rand_names(n = 1, seed = NULL, gender = NULL, nationality = NULL, key = NULL)

Arguments

n
Number of names required. Free users get 100 max and registered RandomAPI users get 500 max. Register for a free API key here: https://randomapi.com
seed
A random string to ensure same results
gender
male or female
nationality
Currently takes: AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NL, NZ, TR, US
key
An API key for more results per request (500 max for registered RandomAPI users).

Details

The return object contains the following fields: seed, user.password, user.sha256, user.cell, user.name.title, user.location.city, user.picture.medium, user.gender, user.salt, user.registered, user.SSN, user.name.first, user.location.state, user.picture.thumbnail, user.email, user.md5, user.dob, user.version, user.name.last, user.location.zip, user.NINO, user.username, user.sha1, user.phone, user.nationality, user.location.street, user.picture.large.

Examples

Run this code
data <- rand_names(5)
# dplyr::select(data, first = name.first, last = name.last)

 # x <- 5 %>%
 #   rand_names %>%
 # dplyr::filter(gender == "female") %>%
 #  dplyr::select(name.first, name.last)

Run the code above in your browser using DataLab