While doing NLP in R, I am getting following error - 'no applicable method for 'meta' applied to an object of class "character"' when I run dtm <- DocumentTermMatrix(corpus) command.

0 votes
My previous code has been as below -

corpus <- VCorpus(VectorSource(final_data$comment))
corpus <- tm_map(corpus, content_transformer(tolower))
corpus <- tm_map(corpus, removeNumbers)
corpus <- tm_map(corpus, removePunctuation)
corpus <- tm_map(corpus, removeWords, stopwords())
corpus <- tm_map(corpus, stemDocument)
corpus <- tm_map(corpus, removeWords, 'brw')
corpus <- tm_map(corpus, removeWords, 'cid')
corpus <- tm_map(corpus, stripWhitespace)
corpus <- tm_map(corpus, trimws)
dtm <- DocumentTermMatrix(corpus)

I am getting following error on last command -

'no applicable method for 'meta' applied to an object of class "character"'

Can you please let me know how to fix it ?
Apr 20 in Machine Learning by Adil
• 120 points
82 views

1 answer to this question.

0 votes

Hi, @Adil,

I would suggest you go through this: https://www.edureka.co/community/29835/applicable-method-applied-trying-create-termdocumentmatrix

I hope this will solve your issue.

answered Apr 20 by Gitika
• 37,370 points

Related Questions In Machine Learning

0 votes
1 answer

tensorflow is installed but when importing in pycharm gets an error

Hi@soniya, This problem is related to the version. ...READ MORE

answered Sep 14 in Machine Learning by MD
• 56,480 points
40 views
0 votes
1 answer

After installation of tensorflow ,attribute error: no Session module exists

To install TensorFlow you need to have ...READ MORE

answered Mar 16 in Machine Learning by Sirajul
• 57,940 points
209 views
0 votes
1 answer

How to add one new column in an existing dataset?

Hi@akhtar, You can do this task using numpy ...READ MORE

answered Apr 17 in Machine Learning by MD
• 56,480 points
95 views
0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,820 points
463 views
+1 vote
1 answer