[R] using inspect with a TermDocumentMatrix to convert to a data frame

Erin Hodgess
2014-12-05T03:53:19Z

Hello!

I am working through the "Social Media Mining with R" book and I have
something that is a bit problematic.

Here is the code:

 hash2_tdm <- TermDocumentMatrix(hash2_corpus)
       print(hash2_tdm)
       print(findFreqTerms(hash2_tdm,lowfreq=10))
       hash3_tdm <- removeSparseTerms(hash2_tdm,0.92)

       hash3.df <- as.data.frame(inspect(hash3_tdm))

Now when the hash3.df is created, the entire data frame is printed on the
console.  That's ok if the data frame is relatively small, but is not
acceptable for a large data frame.

Has anyone run into this before, please?  I have tried all kinds of other
options for converting to a data frame, but to no avail.


This is on R-3.1.2, on Ubuntu 14.0.4

Thanks!
Sincerely,
Erin


--
Erin Hodgess
Associate Professor
Department of Mathematical and Statistics
University of Houston - Downtown
mailto: erinm.hodgess at gmail.com