I am still new to R, so this may be a stupid question, but:
I have two variables (gender [0,1] and vote [0,1).
I want to merge the two variables into one variable with four different values:
1) Gender=0, Vote=0
2) Gender=1, Vote=0
3) Gender=0, Vote=1
4) Gender=1, Vote=1
I guess I will need the if command, but it somehow won't work out for me.
Hope, anyone can help me :)
expand.gridi.e.expand.grid(gender=0:1, vote=0:1)Gender+2*Vote.interaction().