> DTM <-documenttermmatrix (corpus)
Error: not all inherits (Doc, "textdocument") are true.
Solution:
It seems this wowould have worked just fine inTM 0.5.10But changes inTM 0.6.0Seems to have broken it. The problem is that the functionsTolowerAndTrimWon't necessarily return textdocuments (it looks like the older version may have automatically done the conversion). They instead return characters and the documenttermmatrix isn't sure how to handle a corpus of characters.
So you cocould change
Corpus_clean <-tm_map (news_corpus, content_transformer (tolower ))
Or you can run
Corpus_clean <-tm_map (corpus_clean, plaintextdocument)
After all of your non-standard transformations (those not inGettransformations ()) Are done and just before you create the documenttermmatrix. That shoshould make sure all of your data is in plaintextdocument and shocould make documenttermmatrix happy.
From: http://stackoverflow.com/questions/24191728/documenttermmatrix-error-on-corpus-argument
R-package 'TT' documenttermmatrix get Error