when I try to apply stemCompletion to the body, this function generates NA values.
this is my code:
my.corpus <- tm_map(my.corpus, removePunctuation) my.corpus <- tm_map(my.corpus, removeWords, stopwords("english"))
(one of the results: [[2584]] zoning plan)
The next step is the stamp of the case and so:
my.corpus <- tm_map(my.corpus, stemDocument, language="english") my.corpus <- tm_map(my.corpus, stemCompletion, dictionary=my.corpus_copy, type="first")
but the result of this is
[[2584]] NA Plant
the next step is to create a matrix of incidents with transactions and then rules a priori, but if I continue and try to get the rules, the check (rules) function will give me this error:
> inspect(rules) Errore in UseMethod("inspect", x) : no applicable method for 'inspect' applied to an object of class "c('rules','associations')"
what problem? I believe that NA values do not generate the incident matrix correctly, and then good rules .. is this a problem? if so, how can I solve it?
this is an abstract question:
this is an abstract: my.words = c("β cell","zoning policy regional index brazil","zoning plan","zolpidem adult","zizyphus spinosa hu") my.corpus = Corpus(VectorSource(my.words)) my.corpus_copy = my.corpus my.corpus = tm_map(my.corpus, removePunctuation) my.corpus = tm_map(my.corpus, removeWords, c("the", stopwords("english"))) my.corpus = tm_map(my.corpus, stemDocument, language="english") my.corpus <- tm_map(my.corpus, stemCompletion, dictionary=my.corpus_copy, type="first") inspect(my.corpus)