Brian Vanover Brian Vanover - 1 month ago 11
R Question

Adding custom stopwords in R tm

I have a Corpus in R using the

tm
package. I am applying the
removeWords
function to remove stopwords

tm_map(abs, removeWords, stopwords("english"))


Is there a way to add my own custom stop words to this list?

Answer

stopwords just provides you with a vector of words, just combine your own ones to this.

tm_map(abs, removeWords, c(stopwords("english"),"my","custom","words"))