title: R ggplot bar graph with color filled, how to normalized each column to percentage?
body: <p>I have a bar graph with color filled plotting like this, </p>
  
  <pre><code>ggplot(mtcars) + aes(x=factor(cyl), fill=factor(vs))+geom_bar()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/k3OJn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k3OJn.png" alt="enter image description here"></a></p>
  
  <p>How to transform each column to percentage? something like the following? </p>
  
  <p>Any hint is appreciated. Thank you!</p>
  
  <p><a href="https://i.stack.imgur.com/pJv2C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pJv2C.png" alt="enter image description here"></a></p>