I have a data frame with several columns, here is an example of one of the columns:
df <- data.frame(x=1:3)
The number 1 stands for "Yes", 2 stands for "No" and 3 stands for "Maybe". One solution that I came up with was to change the class of the variable and then used:
df$x <- replace(df$x, "1", "Yes") and repeat it for the "No" and "Maybe".
However one of the columns have 27 different values that stands for 27 different words, the code would be too big doing by this way.
Any ideas of how to replace the numbers by the words efficiently?