parse_factor {readr} | R Documentation |
Parse a character vector into a factor
parse_factor(x, levels, ordered = FALSE, na = c("", "NA"), locale = default_locale()) col_factor(levels, ordered = FALSE)
x |
Character vector of values to parse. |
levels |
Character vector providing set of allowed levels. |
ordered |
Is it an ordered factor? |
na |
Character vector of strings to use for missing values. Set this
option to |
locale |
The locale controls defaults that vary from place to place.
The default locale is US-centric (like R), but you can use
|
Other parser: parse_atomic
,
parse_datetime
, parse_guess
,
parse_number
parse_factor(c("a", "b"), letters)