Warning Message

I'm getting error when I try to clean some data.
These are my codes and when i run last line it gives warning message.

#Cleaning Tweets with Text-mining
install.packages("tm")
library(tm)

mycorpus <- Corpus(VectorSource(trump$text))
mycorpus <- tm_map(mycorpus, removeWords, stopwords())

Warning message: "In tm_map.SimpleCorpus(mycorpus, removeWords, stopwords()) :
transformation drops documents"

Please provide me some solution.
Thanks!

That warning message is normal because you are removing stop words, the logical thing to expect is to lose documents.
Can you explain what is your issue with this or what would be the expected behavior?

1 Like

try this ?
if it doesnt work I'll need to know more about 'trump$text"

install.packages("tm")
library(tm)
 
mycorpus <- VCorpus(x = VectorSource(trump$text),
                     readerControl = list(reader=readPlain,
                                          language="en"))
mycorpus <- tm_map(mycorpus, removeWords, stopwords())
1 Like

Thank you so much! your codes actually worked. :heart: :heart:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.