title: Avoiding automatic conversion of dgCMatrix to dgeMatrix
body: <p>I use the class <code>dgCMatrix</code> from the <code>Matrix</code> package to store a square matrix of about 255 million values, with a size of about 1.7MB .</p>
  
  <p>However after I perform <code>variable &lt;- variable/rowSums(variable)</code> where <code>variable</code> is the sparse matrix, the resulting variable changes into class <code>dgeMatrix</code>, and the size ballooned to almost 2GB, effectively taking up all memory available and in some instances crashing the script.</p>
  
  <p>Is there a way to coerce the output to remain in the class <code>dgCMatrix</code> ?</p>
  
  <p>I suspect that the reason is that the number of non-zero elements increase to the point that the matrix is no longer considered sparse, due to introduction of NaN in elements where the sum of rows is zero. If there's a work around to address the NaN 's , I'm open to that too. Note however that I cannot avoid producing the zero rows, because my matrix need to be a square, and the corresponding column sums are generally non-zero.</p>