Description Usage Arguments Value Examples
gen_firstname
randomly sample a firstname from the selected database:
country
If is 'uk', the function will automatically sample a
firstname that based on the gender
and birthyear
. The uk
firstname database was extracted from
https://www.ons.gov.uk/peoplepopulationandcommunity/birthsdeathsandmarriages/livebirths/bulletins/babynamesenglandandwales/2018/relateddata
containing firstnames and their frequencies in England and Wales from 1996 to 2018.
If country
is 'us', the function will automatically sample a
firstname that based on the gender
and race
. The us
firstname database was extracted from randomNamesData
.
1 | gen_firstname(country = "uk", gender = NA, birthyear = NA, race = NA)
|
country |
A string variable with a default of 'uk'. It is either 'uk' or 'us'. |
gender |
A string variable either 'male' or 'female'. |
birthyear |
A number from 1996 to 2018. For number smaller than 1996 will assumes as 1996 and greater than 2018 will assumes aas 2018. |
race |
A number or a string of the ethnicity code: 1 American Indian or Native Alaskan, 2 Asian or Pacific Islander, 3 Black (not Hispanic), 4 Hispanic, 5 White (not Hispanic) and 6 Middle-Eastern, Arabic. |
A name string.
1 2 3 | gen_firstname(country = "uk", gender = "male", birthyear = 2013)
gen_firstname(country = "us", gender = "male", race = 2)
gen_firstname(country = "us", gender = "male", race = 'Hispanic')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.