transform_vars | R Documentation |
Transform the values of numeric variables by applying a mathematical function
transform_vars(data, vars, fn, names = NULL)
data |
a dataframe with the variables to transform |
vars |
a character of the numeric variables in |
fn |
the name (a string) of a valid R function |
names |
the names of the new variables |
the original dataframe containing the new columns of the transformed variable with tidyverse code attached
Zhaoming Su
code
transformed <- transform_vars(iris,
var = "Petal.Length",
fn = "log"
)
cat(code(transformed))
head(transformed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.