How to make proportional stacked barchart using ggplot
<p>I have a data-frame like this:</p>

<pre><code>C1 C2
A  Y
A  N
B  Y
C  Y
A  Y
D  N
E  Y
D  Y
</code></pre>

<p>using this code</p>

<pre><code>ggplot(df,aes(x=C1,fill=C2) + geom_bar() + coord_flip() + xlab("C1")+ylab("Frequncy")
</code></pre>

<p>I can make stacked barchart but it shows frequency. stacked chart like <a href="http://www.r-bloggers.com/when-to-use-stacked-barcharts/" rel="nofollow">here</a> which shows proportion of frequency of c2 for each c1 value.</p>

<p>EDIT: I did not find any similar question as I am looking to show proportional stacked barchart in a away that each bar has 100 percent and divided in two part based on percentage of frequency of C2 for value of C1. for example for A, we have 2 Y and 1 N. So I want a bar that shows (66% Y and 33% N for A) and similar for other values in C1.</p>