I have a large data set in which I'm looking to create a new column that renames categorical variables that are in an existing column. The three possible values in the existing column (called "Side") are 'l', 'r', and 'c'. In the new column I want observations labeled 'l' in the existing column to be named 'green', ones named 'r' to be labeled red, and 'c' to be labeled 'yellow'.
I want this:
Individual  Side  
1            l
2            r
3            c
4            r
...
To become this:
Individual  Side     Code
1            l       green
2            r       red
3            c       yellow  
4            r       red
...
My apologies for the relatively basic question--I'm not all that good with loops, etc. Thanks in advance.
 
     
     
     
     
    