I have a data frame, where I would like to render some of the columns as factor (at the moment they are numeric).
For example:
dd = data_frame( x = c(0, 0, 0, 1, 1, 1), y = c(1,2,3,4,5,6))
I would like to make only the first column a factor:
lapply(dd[,1], as.factor)
But the result is a list (of a factor), and is not saved back to the original data frame.
Is there a way to achieve this?