Error while creating the TDM - "No applicable method for 'meta' applied to an object of class "character""

20 Views Asked by At

While creating the tm package TermDocumentMatrix, i am getting error. following code i have used.

int_vc <- VCorpus(int_vc)

int_vc <- tm_map(int_vc, tolower)
int_vc <- tm_map(int_vc, removePunctuation)
int_vc <- tm_map(int_vc, removeNumbers)
inv_vc <- tm_map(int_vc, removeWords, stopwords("english"))
int_vc <- tm_map(int_vc, stripWhitespace)

inv_tdm <- TermDocumentMatrix(int_vc)

Error in UseMethod("meta", x): no applicable method for 'meta' applied to an object of class character

1

There are 1 best solutions below

0
yem On

This is Error due to content transformation:

My Earlier Code:

int_vc <- tm_map(int_vc, tolower)

I have changed to:

int_vc <- tm_map(int_vc, content_transformer(tolower))

Now this code is working fine.