# NOT RUN {
data(okc)
rec <-
recipe(~ diet + location, data = okc) %>%
step_unknown(diet, new_level = "unknown diet") %>%
step_unknown(location, new_level = "unknown location") %>%
prep()
table(juice(rec)$diet, okc$diet, useNA = "always") %>%
as.data.frame() %>%
dplyr::filter(Freq > 0)
tidy(rec, number = 1)
# }
Run the code above in your browser using DataLab