title: Wilcoxon test in R - x must be numeric error
body: <p>I have a problem with the <code>wilcox.test</code> in R. 
  My data object is a matrix in which the first column contains a name, and all other columns contain a (gene expression) measurement, which is numeric: </p>
  
  <pre><code>str(myMatrix)
  'data.frame':   2000 obs. of  143 variables:
  $ precursor               : chr  "name1" "name2" "name3" "name4" ...
  $ sample1: num  1.46e-03 2.64e+02 1.46e-03 1.46e-03 1.46e-03 ...
  $ sample2: num  1.46e-03 1.91e+02 1.46e-03 1.46e-03 1.46e-03 ...
  $ sample3: num  1.46e-03 3.01e+02 1.46e-03 1.46e-03 4.96 ...
  </code></pre>
  
  <p>For all of the 2000 rows I want to test whether there is a difference between 2 given parts of the matrix. I tried this in 4 different ways:</p>
  
  <pre><code>wilcox.test(as.numeric(myMatrix[i,2:87],myMatrix[i,88:98]))$p.value
  #[1] 1.549484e-16
  
  wilcox.test(myMatrix[i,2:87],myMatrix[i,88:98])$p.value
  #Error in wilcox.test.default(myMatrix[i, 2:87], myMatrix[i, 88:98]) : 
  #'x' must be numeric
  
  t.test(as.numeric(myMatrix[i,2:87],myMatrix[i,88:98]))$p.value
  #[1] 0.2973957
  
  t.test(myMatrix[i,2:87],myMatrix[i,88:98])$p.value
  #[1] 0.3098505
  </code></pre>
  
  <p>So as you can see, only if I use <code>as.numeric()</code> on the already numeric values I get a result without an error message for the Wilcoxon test, but the results completely differ from <code>t.test</code> results even if they should not. </p>
  
  <p>Manually verifying by using an online tool shows that the <code>t.test</code> results using <code>as.numeric()</code> values are wrong.</p>
  
  <p>Any suggestions about how I can solve this problem and do the correct Wilcoxon test? If you need more information let me know.</p>