title: Creating a side by side bar plot with 1 continuous variable and 2 factor variables (one for stacking and the other for grouping bars)
body: <p>I have a dataframe in long format as follows (sample):</p>
  <pre><code>QuarterPeriod &lt;- c(rep(&quot;2011_Q1&quot;,4), rep(&quot;2011_Q2&quot;,4), 
                     rep(&quot;2011_Q3&quot;,4), rep(&quot;2011_Q4&quot;,4), 
                     rep(&quot;2012_Q1&quot;,4), rep(&quot;2012_Q2&quot;,4))
  HFGroup &lt;- c(rep(c(&quot;Phase I&quot;,&quot;Phase II&quot;),12))
  QuantGroup &lt;- c(rep(c(rep(&quot;Declared&quot;, 2), 
                        rep(&quot;Verified&quot;, 2)),6))
  Values &lt;- c(sample.int(25:100, 24))
  
  df &lt;- as.data.frame(cbind(QuarterPeriod, HFGroup,
                            QuantGroup,Values))
  </code></pre>
  <p>and I have the following code to create 2 bar charts using one factor variable for facetting and another to group bars within the plots:</p>
  <pre><code>require(ggplot2)
  ggplot(data=df,
         aes(x=QuarterPeriod, y= Values,
             fill=QuantGroup)) +
    geom_bar(stat=&quot;identity&quot;, position=position_dodge()) +
    facet_wrap(~HFGroup)
  </code></pre>
  <p>Instead of using facetting to get 2 plots, I want 1 plot whereby the 2 factor variables (QuantGroup and HFGroup) are used for:</p>
  <ol>
  <li>Stacking (HFGroup): have phase II on top of phase I</li>
  <li>Grouping (QuantGroup): Have Declared and Verified data for the same quarter be plotted side by side.</li>
  </ol>
  <p>At the end, for say 2011_Q1, there should be 2 bars (one for declared data and another for verified data) but each bar should be showing phase I &amp; II stacked on top of each other.</p>