title: Basic operations on Simple Triplet Matrix (Document Term Matrix)
body: <p>I am struggling to understand how to do basic operations with Simple Triplet Matrix produced by <code>TermDocumentMatrix()</code> of the <code>tm</code> package. </p>
  
  <p>It seems that the problem could be with the matrices not being recognized as numeric.</p>
  
  <pre><code>library(tm)
  data("crude")
  tdm &lt;- TermDocumentMatrix(crude)
  
  vector &lt;- tdm[,1]
  matrix &lt;- tdm[,2:20]
  
  multiplication &lt;- t(vector) %*% matrix
  
  # Error in t(vector) %*% matrix : 
  #   requires numeric/complex matrix/vector arguments
  </code></pre>
  
  <p>But </p>
  
  <pre><code>multiplication &lt;- t(as.matrix(vector)) %*% as.matrix(matrix)
  multiplication
  # Docs
  # Docs  144 191 194 211 236 237 242 246 248 273 349 352 353 368 489 502 543 704 708
  # 127 232  56  62  65 201 214  61 159 244 197  51  90  71  84  96 126  90 152  11
  </code></pre>
  
  <p>I have a very large Term Document Matrix which doesn't allow me to transform the sparse matrix into a dense matrix with as.matrix(). </p>
  
  <p>Is there any way to operate directly on the Simple Triplet Matrix without applying transformation into different classes (like <code>sparseMatrix()</code> of the Matrix package)?</p>