title: stacked bar chart of percentages by group
body: <p>I am trying to create a bar chart with the following data</p>
  
  <pre><code>fac &lt;- c("A","A","B","B","A","A")
  test1 &lt;- c(1,2,1,1,1,3)
  test2 &lt;- c(2,1,3,3,3,1)
  test3 &lt;- c(1,1,2,2,3,2)
  df &lt;- data.frame(fac,test1,test2,test3)
  </code></pre>
  
  <p>I would like to create two charts (for group A and B in "fac")</p>
  
  <p>each chart will have the percentage on the y-axis and the tests (test1,2,3) on the x-axis and will show the proportion of 1's, 2's and 3's for each test.</p>
  
  <p>So for example, for the chart for group A there will be three bars, each will fill 100%, the first bar will be for test1 and will have the percentage of 1's for test1 in group A (in this case 2/4 1's), the percentage of 2's will be 1/4 and the percentage of 3's will be 1/4)</p>
  
  <p>Hope that makes sense, many thanks!</p>