SyntaxFix
Write A Post
Hire A Developer
Questions
Another short way you could use is a pipe (%<>%) from the magrittr package. It converts the character column mycolumn to a factor.
%<>%
library(magrittr) mydf$mycolumn %<>% factor