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, 2020 in Machine Learning by Adil
• 120 points
1,005 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, 2020 by Gitika
• 65,890 points

Related Questions In Machine Learning

0 votes
1 answer
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, 2020 in Machine Learning by MD
• 95,460 points
3,249 views
0 votes
1 answer
0 votes
1 answer

Calculate the probability in R for sum of two dice rolls

By converting the outer values to a ...READ MORE

answered Apr 4, 2022 in Machine Learning by Nandini
• 5,480 points
2,039 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, 2020 in Machine Learning by Sirajul
• 59,230 points
947 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,840 points
1,713 views
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP