I am trying to remove stopwords from a text saved in a text file (size 500 KB). Even after using the instruction multiple times and after every operation like removing punctuation, numbers, I still see stopwords in the word cloud. Did anyone experience the same issue? Is there a fix to it or am I doing something wrong, please advise. Here is the code
library(tm)
library(wordcloud)
lords <- Corpus (DirSource('searsoutlet/'))
lords <- tm_map(lords, removeWords, stopwords('english'))
lords <- tm_map(lords, content_transformer(tolower))
lords <- tm_map(lords, removeWords, stopwords('english'))
#wordcloud(lords, scale=c(4,0.5), max.words=100, random.order=1, rot.per=0.35, use.r.layout=FALSE, colors=brewer.pal(10, 'Dark2'))
lords <- tm_map(lords, stripWhitespace)
lords <- tm_map(lords, removeWords, stopwords('english'))
lords <- tm_map(lords,removePunctuation)
lords <- tm_map(lords, removeWords, stopwords('english'))
lords <- tm_map(lords,removeNumbers)
lords <- tm_map(lords, removeWords, stopwords('english'))