title: Beside barchart with ggplot2
body: <p>The basic chart functionality in R makes it relatively simple to produce a bar chart with data columns side-by-side, using the <code>beside</code> flag. For instance, this code:</p>
  
  <pre><code>test1 &lt;- c(2,4)
  test2 &lt;- c(4,5)
  data &lt;- data.frame(test1, test2)
  barplot(
      as.matrix(data), 
      cex.lab = 1.5, 
      cex.main = 1.4, 
      beside=TRUE
      )
  </code></pre>
  
  <p>Produces this chart:</p>
  
  <p><a href="https://i.stack.imgur.com/A7VZp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A7VZp.png" alt="enter image description here"></a></p>
  
  <p>I would like to produce a similar chart with <code>ggplot2</code>, but <a href="http://docs.ggplot2.org/current/geom_bar.html" rel="nofollow noreferrer">the <code>geom_bar</code> function does not have a <code>beside</code> flag</a>. Can a similar bar chart be produced with <code>ggplot2</code>?</p>