title: Relative frequency histogram in R
body: <p>I need a histogram using the relative frequency. This is the code that I'm using. I'd like to have 7 bars instead of 10. How could I change that?</p>
  <pre><code>histo&lt;-hist(DatosTA1$Datos)
  barplot(histo$counts/50,col=&quot;green&quot;,space=0)-&gt;bp   # n=length(variable)
  axis(1,at=b,labels=b)
  title(ylab=&quot;Frecuencia relativa&quot;,xlab=&quot;Distribución de frecuencias 
                  del tiempo relativo&quot;) 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/eBx9z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eBx9z.png" alt="enter image description here" /></a></p>