title: Plot percentage of factor levels in R ggplot
body: <p>I have a table of use of vehicles where each record shows how many vehicles are for each kind of use.
  I need to plot the percentage of vehicles for each use. Below I provide sample data:</p>
  <pre><code>use &lt;- as.factor('private’, 'comercial', 'ambulance’, 'private’, 'comercial')
  quantity &lt;- c(2,1,4,6,1)
  mydata &lt;- data.frame(use, quantity)
  </code></pre>
  <p>In this case there should be private: 8, comercial: 2 and ambulance: 4
  I have tried the following but I think that it counts the records and not the vehicles (private: 2, comercial: 2 and ambulance: 1)</p>
  <pre><code> library(scales)
      library(ggplot2)
      ggplot(mydata, aes(x = factor(use))) + geom_bar(aes(y = (..count..)/sum(..count..))) + coord_flip() +  
  scale_y_continuous(labels = scales::percent)
  </code></pre>
  <p>If i change the code:</p>
  <pre><code> ggplot(mydata, aes(x = factor(use))) + geom_bar(aes(y = (quantity)/sum(quantity))) + coord_flip() +  
  scale_y_continuous(labels = scales::percent)
  </code></pre>
  <p>I receive this error:
  Error: stat_count() can only have an x or y aesthetic.</p>