Closed topepo closed 1 year ago
First seen in tidymodels/TMwR#367
library(tidymodels)
tidymodels_prefer() theme_set(theme_bw()) options(pillar.advice = FALSE, pillar.min_title_chars = Inf)
ns_rec <- recipe(mpg ~ ., data = mtcars) %>% step_ns(disp, deg_free = 3) %>% prep() bake(ns_rec, mtcars %>% slice(1)) #> Error in if (num < 1) {: argument is of length zero ns2_rec <- recipe(mpg ~ ., data = mtcars) %>% step_spline_natural(disp, deg_free = 3) %>% prep() bake(ns2_rec, mtcars %>% slice(1)) #> Error in if (num < 1) {: argument is of length zero
Created on 2023-08-25 with reprex v2.0.2
For step_ns(), it is an issue with stripping off attributes (I assume the dim attribute).
step_ns()
dim
For step_spline_natrual(), it is using I() rowwise that is dropping the dimension.
step_spline_natrual()
I()
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.
First seen in tidymodels/TMwR#367
Created on 2023-08-25 with reprex v2.0.2
For
step_ns()
, it is an issue with stripping off attributes (I assume thedim
attribute).For
step_spline_natrual()
, it is usingI()
rowwise that is dropping the dimension.