Open EmilHvitfeldt opened 4 months ago
library(recipes) rec <- recipe(~ mpg, data = mtcars) |> step_discretize(mpg, min_unique = 4) |> prep() rec |> bake(data.frame(mpg = c(NA, 3))) #> # A tibble: 2 × 1 #> mpg #> <fct> #> 1 <NA> #> 2 bin1 rec |> bake(data.frame(mpg = c(3))) #> # A tibble: 1 × 1 #> mpg #> <fct> #> 1 bin1 rec |> bake(data.frame(mpg = c(NA))) #> Error in cut.default(new_data, object$breaks, labels = labs, include.lowest = TRUE): 'x' must be numeric