title: R package reshape function melt error: id variables not found in data when working with a lot of factors
body: <p>I am working with a rarefaction output from <a href="http://www.mothur.org/" rel="noreferrer">mothur</a>, which basically gives me a dataset containing the number of sequences sampled and the number of unique sequences in several samples. I would like to use ggplot2 to visualize this data and therefore need to use <code>melt</code> to go from a <code>wide</code> to a <code>long</code> format. </p>
  
  <p>The problem is that I find no way to make this work due to an error of <code>melt</code>. Which basically states </p>
  
  <blockquote>
    <p>Error: id variables not found in data: 1,3,6, (... and so on)</p>
  </blockquote>
  
  <p>Because of the size of the original dataset it would be impractcal to share it here nonetheless one should be able to recreate the same problem using the following code:</p>
  
  <pre><code>a&lt;-seq(0,300,3)
  b&lt;-runif(length(a))
  c&lt;-runif(length(a))
  d&lt;-as.data.frame(cbind(a,b,c))
  d$a&lt;-as.factor(d$a)
  melt(d,d$a)
  </code></pre>
  
  <p>Which gives exactly the same error:</p>
  
  <blockquote>
    <p>Error: id variables not found in data: 0,3,6,9, (...)</p>
  </blockquote>
  
  <p>I fail to see what I am doing wrong. I am using R 2.15.1 on ubuntu server 12.04. Both the function <code>reshape::melt</code> and <code>reshape2::melt</code> result in the same error.</p>