0

I am new to tm package in R. I am running the following code on corpus but output of DocumentTermMatrix is not considering all the terms.

corpus = Corpus(VectorSource(text))
corpus = tm_map(corpus, PlainTextDocument)
dtm = DocumentTermMatrix(corpus)
dtm
# DocumentTermMatrix (documents: 20517, terms: 2)

It shows only two terms whereas I have more than 15 terms in my data set. Can anyone help here please?

smci
  • 29,564
  • 18
  • 109
  • 144
Lal
  • 23
  • 5
  • 3
    Please create a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – MrFlick Apr 30 '15 at 05:08
  • Please create a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) or else this is likely to be downvoted/closed. – smci Jun 29 '15 at 00:45

0 Answers0