gender_mutate_df | R Documentation |
This function uses ropensci/gender to convert first names in a dataframe and obtain additional columns from the ropensci/gender outcome. This function complements ropensci/gender to be directly used with dataframes
gender_mutate_df( df, input_name, years = c(1932, 2012), method = "ssa", countries = "United States" )
df |
Dataframe containing a column of first names |
input_name |
The name of the column containing first names in given df |
years |
Which years to use for inferring gender: defaults to 1932-2012. |
method |
Which method to use for inferring gender: defaults to "ssa". |
countries |
Which country to use as a baseline: defaults to the U.S. |
df <- data.frame( NameFirst = c("Madison", "Nimrodel", "Michael"), stringsAsFactors = FALSE ) gender_mutate_df(df, "NameFirst", years = c(1920, 2010))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.