title: Exact number of bins in Histogram in R
body: <p>I'm having trouble making a histogram in R. The problem is that I tell it to make 5 bins but it makes 4 and I tell to make 5 and it makes 8 of them.</p>
  
  <pre><code>data &lt;- c(5.28, 14.64, 37.25, 78.9, 44.92, 8.96, 19.22, 34.81, 33.89, 24.28, 6.5, 4.32, 2.77, 17.6, 33.26, 52.78, 5.98, 22.48, 20.11, 65.74, 35.73, 56.95, 30.61, 29.82);
  
  hist(data, nclass = 5,freq=FALSE,col="orange",main="Histogram",xlab="x",ylab="f(x)",yaxs="i",xaxs="i")
  </code></pre>
  
  <p>Any ideas on how to fix it?</p>