I have a data frame that I read from a csv file. the contents of the data frame are as follows.
NAME CURR_GENDER COUNT
1 LESLIE N 186
2 COREY N 86
3 KELSEY N 52
4 DARYL N 38
5 PRISCIANDARO N 33
6 SUNG N 30
I am trying to determine the gender using a gender library with a name and adding output as a column to an existing data frame.
csv_in <- "Names.csv"
Names_df <- read.csv(csv_in)
gender(Names_df$NAME,
method = "ssa",
years = c(1930, 2012)) %>%
do.call(rbind.data.frame, .)
However, I get the following error. Hoping you can point out what I'm doing wrong here.
Gender error (Names_df $ NAME, method = "ssa", years = c (1930, 2012)): Data must be a character vector.
source
share