title: converting a dgCMatrix to data frame
body: <p>I would like to convert a sparse matrix into a data frame of the type (row,column, value).  I have found questions such as <a href="http://r.789695.n4.nabble.com/Converting-sparse-matrix-to-data-frame-in-Matrix-package-td2332012.html" rel="noreferrer">http://r.789695.n4.nabble.com/Converting-sparse-matrix-to-data-frame-in-Matrix-package-td2332012.html</a> that in the question start with row,column,value and create a sparse matrix.  I want the inverse, and I cannot use the as.matrix function, because the matrix is too large.  Here is a small example.</p>
  
  <pre><code>r = c(1,2,2,3,3)
  c = c(4,1,2,3,5)
  v = c(1,2,1,3,1)
  
  a = sparseMatrix(i=r,j=c,x=v) 
  
  3 x 5 sparse Matrix of class "dgCMatrix"
  
  [1,] . . . 1 .
  [2,] 2 1 . . .
  [3,] . . 3 . 1
  </code></pre>
  
  <p>Can I get a data.frame</p>
  
  <pre><code>  r c v
  1 1 4 1
  2 2 1 2
  3 2 2 1
  4 3 3 3
  5 3 5 1
  </code></pre>
  
  <p>Thank you</p>