[R] Error on Text Mining for WordCloud

SHIVI BHATIA shivi.bhatia at safexpress.com
Fri Feb 12 20:33:32 CET 2016


Dear Team, 

 

Please suggest on the below error while I am building a WordCloud on R for
one of user twitter account:

 

Error in UseMethod("TermDocumentMatrix", x) : 

  no applicable method for 'TermDocumentMatrix' applied to an object of
class "c('double', 'numeric')"

 

 

I have tried searching a lot on this issue however don't get much help. 

 

Used Tm package and corpus. Below are the expression below:

 

as.character(nwCorp1<- tm_map(corpuss1, removeNumbers))

as.character(nwCorp1<- tm_map(nwCorp1, removePunctuation))

as.character(nwCorp1<- tm_map(nwCorp1,PlainTextDocument))

as.character(nwCorp1<- tm_map(nwCorp1, removeWords,stopwords("english")))

as.character(nwCorp1<- tm_map(nwCorp1,stripWhitespace))

as.character(nwCorp1)

 

dtm11<- DocumentTermMatrix(nwCorp1)

dtm11

dtm12<- as.matrix(dtm11)

dtm12

frequency<- colSums(dtm12)

 

 

Thanks, Shivi

Mb: 9891002021

 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20160213/134d90da/attachment.pl>


More information about the R-help mailing list