when i try to apply stemCompletion to a corpus , 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 result of this is: [[2584]] zoning plan )
the next step is stamming corpus 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 result is this
[[2584]] NA plant
the next step should be the creation of an incidence matrix with transactions and then apriori rules but if i go on and try to get rules, the inspect(rules) function gives 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's the problem? i suppose that NA values don't generate correctly the incidence matrix and then good rules.. is this the problem? if so how i can solve it?
this is an abstract of the problem:
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)