powered by
Create a new variable by using a valid R expression and returns the result along with tidyverse code used to generate it.
createNewVar(.data, new_var = "new.variable", R_exp)
original dataframe containing the new column created from R_exp
R_exp
with tidyverse code attached
a dataframe to which to add a new variable to
a character of the new variable name. "new.variable" by default
a character of a valid R expression which can generate a vector of values
Owen Jin
code
created <- createNewVar(iris, new_var = "Sepal.Length_less_Sepal.Width", "Sepal.Length - Sepal.Width") cat(code(created)) head(created)
Run the code above in your browser using DataLab