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

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -