title: Using R how to create histogram with relative frequency on the vertical axis?
body: <p>I want to create a histogram with relative frequency on the vertical axis using R.</p>
  
  <pre><code>Data:
  Size: [1, 1.5, 2, 2.5]
  Observations:[2, 8, 23, 1]
  </code></pre>
  
  <p>I would like the size as breaks on the x axis and the relative frequency on y.</p>
  
  <pre><code>obs = c(2, 8, 23, 1)
  Y_data = obs/sum(obs)*100
  </code></pre>
  
  <p>Edit:</p>
  
  <pre><code>hist(Y_data, breaks=seq(1.0, 2.5, 0.5), freq = FALSE)
  </code></pre>
  
  <p>Getting Error: some 'x' not counted; maybe 'breaks' do not span range of 'x'</p>