tw_gender: Matches text with male/female names

Description Usage Arguments Details Value Examples

View source: R/gender.R

Description

Using names+gender dataset, matches a list of Names with a dictionary and sets the gender of the name.

Usage

1
2
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

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.

Value

A factor vector assigning gender to each Name provided.

Examples

1
2
3
# Some list of names
mix <- c('pedro','peter','mariano','maria jose','pablo','paul','jenny')
tw_gender(mix)

gvegayon/twitterreport documentation built on May 17, 2019, 9:30 a.m.