# NOT RUN {
data(biomass)
biomass_tr <- biomass[biomass$dataset == "Training",]
biomass_te <- biomass[biomass$dataset == "Testing",]
# Create a recipe using step_bs() with degree = 3
rec <- recipe(
HHV ~ carbon + hydrogen + oxygen + nitrogen + sulfur,
data = biomass_tr
) %>%
step_bs(carbon, hydrogen, degree = 3)
# Update the step to use degree = 4
rec2 <- rec
rec2$steps[[1]] <- update(rec2$steps[[1]], degree = 4)
# Prep both recipes
rec_prepped <- prep(rec, training = biomass_tr)
rec2_prepped <- prep(rec2, training = biomass_tr)
# Juice both to see what changed
juice(rec_prepped)
juice(rec2_prepped)
# Cannot update a recipe step that has been trained!
# }
# NOT RUN {
update(rec_prepped$steps[[1]], degree = 4)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab