regex - R intersecting strings -


i have following data example:

 basketball = c("miss w. johnson 18' pullup jump shot",                 "miss barnes 12' pullup jump shot",                 "miss carter  19' pullup jump shot") 

how find common words or 'intersect' them have "miss pullup jump shot" result?

this works, i'm not sure how robust given question little vague.

reduce(intersect, strsplit(basketball," ")) #[1] "miss"   "pullup" "jump"   "shot" 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -