powered by
Transform the values of numeric variables by applying a mathematical function
transform_vars(data, vars, fn, names = NULL)
the original dataframe containing the new columns of the transformed variable with tidyverse code attached
a dataframe with the variables to transform
a character of the numeric variables in data to transform
data
the name (a string) of a valid R function
the names of the new variables
Zhaoming Su
code
transformed <- transform_vars(iris, var = "Petal.Length", fn = "log" ) cat(code(transformed)) head(transformed)
Run the code above in your browser using DataLab