Solution of Errors Faced while creating WordCloud and TermDocumene Matrix in R

I have faced two issues, which I thought of sharing with you all:

First one is:
Error in UseMethod(“meta”, x) :
no applicable method for ‘meta’ applied to an object of class “character”

Solution of Errors Faced while creating WordCloud and TermDocumene Matrix in R-1

To resolve this issue:
Use content_Transformer(tolower), you will get rid of above error.

corpus=Corpus(VectorSource(df1$message))
corpus=tm_map(corpus,content_transformer(tolower))
corpus=tm_map(corpus,removePunctuation)
corpus=tm_map(corpus,removeNumbers)
corpus=tm_map(corpus,removeWords,stopwords(“en”))
corpus=Corpus(VectorSource(corpus))
tdm=TermDocumentMatrix(corpus)

Second Issue I faced while installing “WordCloud” package:
Warning in install.packages :
error 1 in extracting from zip file
Warning in install.packages :
cannot open compressed file ‘Rcpp/DESCRIPTION’, probable reason ‘No such file or directory’
Error in install.packages : cannot open the connection

Solution of Errors Faced while creating WordCloud and TermDocumene Matrix in R-2

To resolve this issue:
Use this command:
install.packages(“wordcloud”, repos=”http://cran.us.r-project.org”)

It can be used with any package, in “repos” parameter we are passing actual location of package. This will remove the error and package will be successfully installed.

Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz