I know how to use mutate with ifelse, when the new variable is binary, for example:
mutate(samecolor = ifelse(freqcolor == favcolor, "same", "different"))
But now I want to mutate a categorical variable into another categorical variable that is abbreviated in all values, something like:
mutate(fqclr = case_when(freqcolor == "bright red" ~ "br",
freqcolor == "light yellow" ~ "ly",
freqcolor == "emerald" ~ "ed",
TRUE ~ "wt"))
And this is not working. Anybody knows what I am doing wrong?