title: Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
body: <p>I am trying to conduct a cluster analysis, which requires me to scale/standardise my data. The data is in a matrix and is numeric, however I am only getting the following message:</p>
  <pre><code>Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
  </code></pre>
  <p>Initially, there was a column containing categorical data, so I removed that, thinking this would solve the problem, but I still received the error.</p>
  <p>Following is the chunks of script and 6 rows of data. Any assistance would be greatly appreciated.</p>
  <pre><code>Metals &lt;- as.matrix(d)
  rownames(Metals)&lt;-d$RowLabs
  cols_to_keep &lt;-c(FALSE,TRUE,TRUE,TRUE,TRUE,TRUE) 
  Metals&lt;-Metals[,cols_to_keep]
  head(Metals)
  </code></pre>
  <pre><code>    X88Sr_umol_molCa X25Mg_umol_molCa X55Mn_umol_molCa X7Li_umol_molCa
  CHR1 &quot;1748.3722&quot;      &quot;    80.284613&quot;  &quot; 1.353754e-01&quot;  &quot;   3.2146056&quot; 
  CLR2 &quot;1763.6984&quot;      &quot;   104.850260&quot;  &quot; 4.944963e-01&quot;  &quot;   0.2649073&quot; 
  CLR3 &quot;2245.8861&quot;      &quot;   186.579911&quot;  &quot; 2.124642e-01&quot;  &quot;   1.0715352&quot; 
  CLR4 &quot;1654.9811&quot;      &quot;   124.502777&quot;  &quot; 4.756491e-01&quot;  &quot;   0.2252010&quot; 
  CLR5 &quot;1447.3079&quot;      &quot;   183.703436&quot;  &quot; 4.734605e-01&quot;  &quot;   2.8409970&quot; 
  CLR6 &quot;1731.3718&quot;      &quot;   170.511088&quot;  &quot; 1.728970e-01&quot;  &quot;   2.5984728&quot; 
       X138Ba_umol_molCa
  CHR1 &quot; 1.3426978&quot;     
  CLR2 &quot;10.3955650&quot;     
  CLR3 &quot;12.8552971&quot;     
  CLR4 &quot;12.3339241&quot;     
  CLR5 &quot; 0.9453284&quot;     
  CLR6 &quot; 2.1714244&quot; 
  </code></pre>
  <pre><code>d &lt;- scale(Metals)
  head(Metals)
  </code></pre>
  <p>Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric</p>