R/tidy.R
tidy_sex.Rd
Tidy gender variable
tidy_sex(x, lang = "cn", as_factor = FALSE)
Vector contains gender information.
Character, specify the output language, options are 'cn', or 'en', default is 'cn'.
Logical, indicate whether output value as factor.
A factor vector contains gender information.
gender <- c("male", "men", "women", "female", "women", "man", "1", "2") tidy_sex(gender) #> [1] 1 1 2 2 2 1 1 2