
Last chance! 50% off unlimited learning
Sale ends in
Convert specified variables into factors
convert_to_cat(data, vars, names = NULL)
original dataframe containing new columns of the converted variables with tidyverse code attached
a dataframe with the categorical column to convert
a character vector of column names to convert
a character vector of names for the created variables
Zhaoming Su
code
converted <- convert_to_cat(iris, vars = c("Petal.Width"))
cat(code(converted))
head(converted)
Run the code above in your browser using DataLab