Values not included in levels
- WARNING: Any values not in the level will be silently converted to NA:
## [1] Dec Apr <NA> Mar
## Levels: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- But if you use
forcats::fct()
insted:
#> Error in fct()
:
#> ! All values of x
must appear in levels
or na
#> ℹ Missing level: “Jam”
- If you need to access the valid levels use
levels()
:
## [1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"