I have
myColors <- c("red", "purple", "blue", "blue", "orange", "red", "orange")
library(dplyr)
recode(myColors, red="rot", blue="blau", purple="violett")
However if my data have spaces in them this method does not work
myColors <- c("Color red", "Color purple", "Color blue", "Color blue", "Color orange", "Color red", "Color orange")
recode(myColors, Color red="rot", Color blue="blau", Color purple="violett")
Is there anything I can do to fix this other than changing the data?