title: Change from character to numeric without changing dimensions in R
body: <p>I am calculating module preservation on R with WGCNA by following their tutorial, but I can't run the actual calculation, because it returns an error that it can only do it with numeric data. Sure enough, when I checked:</p>
  
  <pre><code>&gt;is.numeric(datExprCTL)
  [1] FALSE
  &gt;dim(datExprCTL)
  [1] 185 2225
  </code></pre>
  
  <p>So I did the only thing I know to change it, but this is what happened:</p>
  
  <pre><code>&gt;datExprCTL&lt;-as.numeric(datExprCTL)    
  &gt;dim(datExprCTL)
  NULL
  </code></pre>
  
  <p>And when I run my module preservation script, it does say: Error in colSums(!is.na(datExpr[useSamples, useGenes])) : 
    'x' must be an array of at least two dimensions</p>
  
  <p>So, my question is how can I convert to numeric without losing the dimensions and going ahead with module preservation, which needs to have the correct dimensions.</p>