This post explains how you can convert multiple columns (variables) to factor in R using base R and dplyr package, along with various examples.