# NOT RUN {
library(parsnip)
lm_model <- linear_reg()
lm_model <- set_engine(lm_model, "lm")
regularized_model <- set_engine(lm_model, "glmnet")
workflow <- workflow()
workflow <- add_model(workflow, lm_model)
workflow
workflow <- add_formula(workflow, mpg ~ .)
workflow
remove_model(workflow)
fitted <- fit(workflow, data = mtcars)
fitted
remove_model(fitted)
remove_model(workflow)
update_model(workflow, regularized_model)
update_model(fitted, regularized_model)
# }
Run the code above in your browser using DataLab