set.seed(313)
examples <- matrix(rnorm(40)^2, ncol = 2)
examples <- as.data.frame(examples)
rec <- recipe(~ V1 + V2, data = examples)
sqrt_trans <- rec %>%
step_sqrt(all_numeric_predictors())
sqrt_obj <- prep(sqrt_trans, training = examples)
transformed_te <- bake(sqrt_obj, examples)
plot(examples$V1, transformed_te$V1)
tidy(sqrt_trans, number = 1)
tidy(sqrt_obj, number = 1)
Run the code above in your browser using DataLab