Convert specified columns to factor
convert2Factor.Rd
Convert specified columns to factor
Examples
data <- data.frame( Category1 = c("A", "B", "A", "B"),
Category2 = c("X", "Y", "X", "Z"),
Value = 1:4,
stringsAsFactors = FALSE )
## -- Convert columns to factors
convert2Factor(data, columns = c("Category1", "Category2"))
#> Category1 Category2 Value
#> 1 A X 1
#> 2 B Y 2
#> 3 A X 3
#> 4 B Z 4