I am creating a recipe so that I first create a calculated column called "response" as so:
rec <- recipe( ~., data = training) %>%
step_mutate(response = as.integer(all(c('A', 'B') %in% Col4) & Col4 == 'A'))
I would like to now specify this new calculated column as the response variable in the recipe() function as shown below. I will be doing a series of operations on it such as this first one with step_naomit. How do I re-specify my response in recipe() to be the calculated column from my previous step (above) using recipes?
recipe <- recipe(response ~ ., data = training) %>%
step_naomit(recipe, response)