I have a character vector of stopwords in R:
stopwords = c("a" ,
"able" ,
"about" ,
"above" ,
"abst" ,
"accordance" ,
...
"yourself" ,
"yourselves" ,
"you've" ,
"z" ,
"zero")
Let's say I have the string:
str <- c("I have zero a accordance")
How can remove my defined stopwords from str
?
I think gsub
or another grep
tool could be a good candidate to pull this off, although other recommendations are welcome.