I am trying to create a new variable “season” from month variable by using the following script:
alldata_n %>% mutate( season = case_when( month %in% 10:12 ~ "Fall", month %in% 1:3 ~ "Winter", month %in% 4:6 ~ "Spring", month %in% 7:9 ~ "Summer" ))
This is working but when i use the function to see the variable, the “season” variable doesn’t show up.
I tried to save the data in csv format but even then the save data doesn’t show any “season” variable. Where am i going wrong? Can someone please help me with this?
Thanks in advance