I'm using package "wordcloud" with description "Word Cloud" from the R Packages repository. When I create wordcloud from some random text, some words are omitted automatically as they should not be a part of wordcloud. Now, I want to add more words like "this" and "that" to the package so they get excluded from wordcloud as well.
Currently, these words are being excluded from text: "is, to, be, I, not, a, of, out, but, who, here, how, in, some, so, that, it, because, against, Oh, by"
If you don't have to many words to be removed, you can do
set.seed(1) library(wordcloud) stopwords <- c("my", "foo", "buzz") txt <- "hello world. hello my world again. Foo bar fizz buzz." clean <- gsub(paste(stopwords, collapse="|"), "", txt, ignore.case = TRUE) par(mfrow = c(1,2)) wordcloud(txt) wordcloud(clean)