1

I am following the exercise on this link: https://data.library.virginia.edu/reading-pdf-files-into-r-for-text-mining/

In the section of Inspect:

inspect(opinions.tdm[1:10,])

I got this message, and I cannot follow.

Error in [.simple_triplet_matrix(articles.tdm, 1:10, ) : subscript out of bounds

Somebody can help me please! Thanks

Gaviota
  • 11
  • 1
  • 1
    It's probably an out of date guide. What specifically are you trying to do with that code? It's better it you include a minimal [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) in your question itself. – MrFlick Dec 06 '19 at 20:53
  • 1
    This error occurs when there are less than x terms in the opinions.tdm. In this case less than 10, because you are asking to show the first 10 (1:10) results. Use `inspect(opinions.tdm)` to see if you actually have any terms in the termDocumentMatrix. – phiver Dec 07 '19 at 09:25

0 Answers0