title: How can I make a multiple bar chart in ggplot2?
body: <p>I'm struggling a bit with ggplot2 and hoping to learn by example a bit more.</p>
  
  <p>I have a lot of data that looks like like the thing this generates:</p>
  
  <pre><code>data.frame(version=c('v1', 'v1', 'v1', 'v1', 'v2', 'v2', 'v2', 'v2'),
             platform=c('linux', 'linux', 'mac', 'mac',
                        'linux', 'linux', 'mac', 'mac'),
             type=c('a', 'b', 'a', 'b', 'a', 'b', 'a', 'b'),
             count=floor(runif(8, 0, 10000)))
  </code></pre>
  
  <p>I got regular <code>barplot</code> to draw me a stacked bar chart of type for a given OS (by slicing it out with <code>cast</code>, but I've not quite got what I want with ggplot2 yet.</p>
  
  <p>I can manage to plot a single platform by doing something like this (assuming the above is saved as <code>sample</code>):</p>
  
  <pre><code>qplot(version, a, data=cast(sample[sample$platform=='linux',],
                              version ~ type, value="count"),
        geom='bar')
  </code></pre>
  
  <p>Ideally, I'd like that stacked by type (explicitly <code>a</code> in this example -- there are only two types) and then have one per platform appear side-by-side on the same chart grouped by version.</p>
  
  <p>That is, for every version, I'd like three bars (one for each platform) with two stacks each (by type).</p>