I have a .csv file with many variables, and I want to analyse this data using R. Many of the columns are categorical in nature, but encoded as integers. I would like to change the type of these columns to be a factor (or an ordered factor, depending).
While I know how to change the type of a single column (asked several times, for example Converting variables to factors in R), I have a lot of variables (200, say), and it's very annoying to change their types separately by hand. From the name of the column, I can instantaneously decide whether the column is numeric or not.
Is there a way to easily change the column types of a large number of variables (not all to the same type)?
The ideal solution would be interactive, with a single keystroke per variable. I'm using RStudio, so if that has some built-in GUI for easier column type editing, that would be helpful. I'm looking for a UI, really.
There is another question already about changing the type of many columns simultaneously (Change the class of many columns in a data frame). Here, it is explained how to change a range of columns to the same data type. This doesn't help in my case, where I need to decide for every column separately what the right type is.