Reputation: 1
I have 690 sentences an own term list with 500 words,
So I want to make Document term matrix, like:
I've tried to use DocumentTermMatrix
in tm
packages, but I cannot find the way of making matrix own words list. What should I do? Or what packages or function that you recommend?
Upvotes: 0
Views: 407
Reputation: 9303
Define your own vector of stopwords, then remove all Terms that are in that vector.
Basic Idea:
mystopwords <- setdiff(unique(Terms(mydtm)), mywordvect)
mycorpus <- tm_map(mycorpus, removeWords, mystopwords)
(convert mycorpus to DTM gain...)
You'll have to find out on the details yourself.
Upvotes: 0