I have a column in my data frame that is numbers 1, 2, 3, until 31.
column is titled 'game'
R tells me this column consists of Factors with 31 levels.
How do I convert the factors to numbers without it displaying the levels so I can analyze it numerically?
I'm using R studio if that help at all.
If you convert directly from factor to numeric, it will return the levels instead of the actual values. Here it doesn't matter, because it looks like the levels and the values are the same. If they are different, you have to convert to character first, and then to numeric.
df$game <- as.numeric(as.character(df$game))