Hello!
I'm trying to mix together several levels in a factor variable from my database.
For that purpose, I tried to use the function fct_collapse from the forcats package in order to reassign some levels to a new common label. However, after I ran the command, the following error message kept popping up:
Error: unexpected '=' in:
"dataOURT3 <- dataOURT3 %>%
mutate(v_80C = fct_collapse(v_80B, Gauches&ecolos ="
("dataOURT3" is my dataset and "v_80B" the original factor variable whose levels I'm trying to change).
Here is the code section I typed :
library(forcats)
dataOURT3 <- dataOURT3 %>%
mutate(v_80C = fct_collapse(v_80B, Gauches&ecolos =c("1","2","6")))
Does anyone have an idea what is wrong with my use of '=' in that code section?
Thanks a lot for your help!
Paul