Hello,
I have a small problem with recipe(). I construct a new variable (like old_variable^2 etc.) in dataset2 from old existing variables in dataset1.
rec <- recipe(Y ~ X1new + X2 + X3,
data = dataset2
model <- linear_reg() |>
set_engine('lm') |>
set_mode('regression')
R produces a weird error message:
Error in recipes::prep():! Not all variables in the recipe are present in the supplied training set: X1new. Run rlang::last_trace() to see where the error occurred.
=>I checked the X1new exists and has no errors or NAs. What happened?
Of course with other variables it works
Thank you.