I'm working on a questionnaire and I need to turn some observations to NA when two arguments are true. In this case, I want my values to be NA when the variable name starts with "Q" and when the token is equals to the obs I no longer want.
So far I came up with this, which does not work.
Fusion_2_nom <- Fusion_2_nom %>%
mutate_at(vars(starts_with("Q")),
replace(token %in% c("3d4faa","214c61", "a786b6", "52a719", "1f9887", "9b6347"), NA))
How should I go about it?
Thanks!