title: Write a Sparse Matrix to a CSV in R
body: <p>I have a sparse matrix (<code>dgCMatrix</code>) as the result of fitting a <code>glmnet</code>. I want to write this result to a <code>.csv</code> but can't use <code>write.table()</code> the matrix because it can't coerced into a <code>data.frame</code>.</p>
  
  <p>Is there a way to coerce the sparse matrix to either a <code>data.frame</code> or a regular matrix? Or is there a way to write it to a file while keeping the coefficient names which are probably row names?</p>