Im trying to write a code, that will take colnames out of a given vector, and in each of these columns recode 1<-5,2<-4,3<-3,4<-2,5<-1 big5qflip is the vectore of columns that I need to recode out of a questionnaire, I'm having trouble getting it to work, and writing case_when correctly
big5new%>%mutate_at(vars(big5qflip),case_when(
big5qflip==1~5,
big5qflip==2~4,
big5qflip==3~3,
big5qflip==4~2,
big5qflip==5~2
))
thank you!
when I tried the code above I got the follwing error
Error in mutate_at()
:
! .funs
must be a one sided formula, a function, or a function name.
Run rlang::last_error()
to see where the error occurred.