# default lag works on a single feature Code prepped_rec <- recipe(~., data = df) %>% step_lag(x, lag = 0.5) %>% prep(df) Condition Error in `step_lag()`: Caused by error in `prep()`: ! step_lag() requires 'lag' argument to be integer-valued. # empty printing Code rec Message -- Recipe ---------------------------------------------------------------------- -- Inputs Number of variables by role outcome: 1 predictor: 10 -- Operations * Lagging: --- Code rec Message -- Recipe ---------------------------------------------------------------------- -- Inputs Number of variables by role outcome: 1 predictor: 10 -- Training information Training data contained 32 data points and no incomplete rows. -- Operations * Lagging: | Trained # keep_original_cols - can prep recipes with it missing Code rec <- prep(rec) Condition Warning: 'keep_original_cols' was added to `step_lag()` after this recipe was created. Regenerate your recipe to avoid this warning. # printing Code print(rec) Message -- Recipe ---------------------------------------------------------------------- -- Inputs Number of variables by role predictor: 11 -- Operations * Lagging: disp --- Code prep(rec) Message -- Recipe ---------------------------------------------------------------------- -- Inputs Number of variables by role predictor: 11 -- Training information Training data contained 32 data points and no incomplete rows. -- Operations * Lagging: disp | Trained