library(embed)
library(modeldata)
ames$const <- "red"
recipe(Street ~ const, data = ames) |>
step_lencode_glm(const, outcome = vars(Street)) |>
prep()
#> Error in `step_lencode_glm()`:
#> Caused by error in `purrr::map()`:
#> ℹ In index: 1.
#> ℹ With name: const.
#> Caused by error in `contrasts<-`:
#> ! contrasts can be applied only to factors with 2 or more levels