Using names+gender dataset, matches a list of Names with a dictionary
and sets the gender of the name.
Usage
tw_gender(Names, male = NULL, female = NULL, lan = c("en"), rm.no.alpha = TRUE)
Arguments
Names
Character vector of names/text to analyze and match
male
Character vector of male names
female
Character vector of female names
lan
Languaje of the names
rm.no.alpha
Whether or not to remove no alpha characters
Value
A factor vector assigning gender to each Name provided.
Details
The char match is written in C++, which is why it should be fast.
When no male or female names are provided, the function uses
by default the names datasets names_male_en and
names_female_en (if lan='en').
If lan='es' and no list of male or female names is provided, the
function will load the names_male_es and
names_female_es datasets. Note that if lan=c('es','en')
the function will use both.
The argument rm.no.alpha, by default in TRUE set whether or not
to remove no letter characters before analyzing the data.