r - Error in UseMethod("meta", x) : no applicable method for 'try-error' applied to an object of class "character" -
i using tm package in r stemming in corpus. however, got problem when ran documenttermmartix
"error in usemethod("meta", x) : no applicable method 'try-error' applied object of class "character"
here workflow:
library(tm) mycorpus <- corpus(vectorsource(training$fulldescription)) mycorpus <- tm_map(mycorpus, content_transformer(tolower), lazy=true) mycorpus <- tm_map(mycorpus, removepunctuation, lazy=true) mycorpus <- tm_map(mycorpus, removenumbers, lazy=true) mystopwords <- c(stopwords('english'), "available", "via") mycorpus <- tm_map(mycorpus, removewords, mystopwords, lazy=true) dictcorpus <- mycorpus mycorpus <- tm_map(mycorpus, stemdocument, lazy=true) mycorpus <- tm_map(mycorpus, stemcompletion, dictionary=dictcorpus, lazy=true) mydtm <- documenttermmatrix(mycorpus, control=list(wordlengths=c(1, inf), bounds=list(global=c(floor(length(mycorpus)*0.05), inf))))
i tried use 'global bounds' argument limit number of terms last row of code, still can't solve problem. how solve problem?
Comments
Post a Comment