title: How to convert big Sparse Matrix to a data frame in R?
body: <p>I have a big sparse matrix (with 2140 columns and 1183747 rows) and I want to convert it to a data frame in R <strong>(R version 3.3.1)</strong>. I used the following code</p>
  
  <pre><code>dt &lt;- fread("train.csv",
                 colClasses = "character",
                 na.strings = "")
  
  data &lt;- Matrix(as.matrix(dt), sparse = T)
  train &lt;- as.data.frame(as.matrix(data))
  </code></pre>
  
  <p>bu I got the following error:</p>
  
  <pre><code>cannot coerce class "structure("dgCMatrix", package = "Matrix")" to a data.frame
  </code></pre>
  
  <p>Any help would be appreciated. Thanks</p>