Say I have a variable in a data frame which can take values "a", "b", "c", "d" and "e". It may look something like this:
V1
c
d
e
e
d
e
a
c
b
b
However, I know/suspect that "a" and "b" describes pretty much the samt thing, as well as "c" and "d". Therefore, I want to create a new variable where these have the same value, i.e.
V1 V2
c c
d c
e e
e e
d c
e e
a a
c c
b a
b a
I thought this would be easy, but I can't find a way to do it!