title: R Text Mining Term Adjacency Matrix
body: <p>I have created a Document Term Matrix from my Corpus using the <code>tm</code> package.</p>
  
  <pre><code>dtm &lt;- DocumentTermMatrix(myCorpus, control=list(wordLengths=c(4, 20),
         bounds = list(global = c(1,13))))
  </code></pre>
  
  <p>I then created a Term-Term Adjacency Matrix.</p>
  
  <pre><code>ttm_results &lt;- t(as.matrix(dtm)) %*% as.matrix(dtm)
  </code></pre>
  
  <p>When I inspect a sample of my results</p>
  
  <pre><code>ttm_results[200:205, 200:205]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/r9DeN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r9DeN.png" alt="enter image description here"></a></p>
  
  <p>I notice it is a very large but sparse dataset.</p>
  
  <p>How might I remove rows that are <code>essentially zeros</code>?</p>
  
  <p>I consider <code>essentially zero</code> to include rows like 1,2 and 5 which do not have <code>adjacent</code> terms.</p>