| convert_to_cat {iNZightTools} | R Documentation |
Convert specified variables into factors
convert_to_cat(data, vars, names = NULL)
data |
a dataframe with the categorical column to convert |
vars |
a character vector of column names to convert |
names |
a character vector of names for the created variables |
original dataframe containing new columns of the converted variables with tidyverse code attached
Zhaoming Su
converted <- convert_to_cat(iris, vars = c("Petal.Width"))
cat(code(converted))
head(converted)