basically suppose I have 10 columns: (a-j) and columns b and g are the columns that are currently numeric and want to set to factors. How to set these specific columns as factors rather than doing as.factor() and adding them to my existing data frame (my data frame for this example is dataInExample?
libraries I am using are dplyr, and tidyverse
would I use select()?
dataInExample <- as.factor(dataInExample$b) #rather than this and then add it again
dataInExample <- some R code that converts columns b and g to factors in dataInExample