I have this variable month and I want to assign corresponding numbers by creating a new variable like:
Month New variable
January 1
February 2
April 4
March 3
I wanted to use ifelse but i got 4 conditions
here my initial code:
df$newvar=ifelse(df$month=="March"& df$month=="April",3,4)