title: 'x' must be numeric histogram in R
body: <p>I have a dataset with five variables: <code>Dataset</code>, <code>Biome</code>, <code>Species</code>, <code>Growth.form</code> and <code>N.content</code>. I'm trying to make a histogram with the <code>N.content</code> variable only, but I'm getting the error:</p>
  
  <pre><code>Error in hist.default(Ndata, xlab = "Blader", ylab = "N.content", main = "N.content",  : 
  'x' must be numeric
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Here's my script:</p>
  
  <pre><code>mydata &lt;- read.table("Leaf N content.txt", sep="\t", header=TRUE)
  summary(mydata)
  class(mydata)
  str(mydata)
  table(mydata$Growth.form)
  table(mydata$Biome)
  Sumdata &lt;- as.data.frame(with(mydata, table(Biome, Growth.form))) 
  table(Sumdata)
  Ndata &lt;- subset(mydata, select=c(N.content))
  logdata &lt;- log(Ndata)
  par(mfrow=c(1,2)) 
  hist(Ndata, xlab="Blader", ylab="N.content", main="N.content", col= "red")
  hist(logdata, xlab="Blader", ylab="N.content", main="N.content", col= "red")
  </code></pre>