I have a character column in a data frame that contains two or more phrases, each of these phrases is separated by a &&
. I would like R to not differentiate between phrase1 && phrase2
and phrase2 && phrase1
. Any ideas how I could go about this?
Example of the output I'd like...
text = c("a && b", "c && d", "e && f", "d && c", "g && h", "f && e")
desired_result = c("a && b", "c && d", "e && f", "c && d", "g && h", "e && f")
df = data.frame(text, desired_result )