convert_to_cat {iNZightTools} | R Documentation |
Convert variables to categorical variables
Description
Convert specified variables into factors
Usage
convert_to_cat(data, vars, names = NULL)
Arguments
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 |
Value
original dataframe containing new columns of the converted variables with tidyverse code attached
Author(s)
Zhaoming Su
See Also
Examples
converted <- convert_to_cat(iris, vars = c("Petal.Width"))
cat(code(converted))
head(converted)
[Package iNZightTools version 2.0.1 Index]