# NOT RUN {
library(parsnip)
library(recipes)
model <- linear_reg()
model <- set_engine(model, "lm")
base_workflow <- workflow()
base_workflow <- add_model(base_workflow, model)
formula_workflow <- add_formula(base_workflow, mpg ~ cyl + log(disp))
fit(formula_workflow, mtcars)
recipe <- recipe(mpg ~ cyl + disp, mtcars)
recipe <- step_log(recipe, disp)
recipe_workflow <- add_recipe(base_workflow, recipe)
fit(recipe_workflow, mtcars)
# }
Run the code above in your browser using DataLab