powered by
Create new variables by using valid R expressions and returns the result along with tidyverse code used to generate it.
create_vars(data, vars = ".new_var", vars_expr = NULL)
original dataframe containing the new columns created from vars_expr
vars_expr
with tidyverse code attached
a dataframe to which to add new variables to
a character of the new variable names
a character of valid R expressions which can generate vectors of values
Zhaoming Su
code
created <- create_vars( data = iris, vars = "Sepal.Length_less_Sepal.Width", "Sepal.Length - Sepal.Width" ) cat(code(created)) head(created)
Run the code above in your browser using DataLab