title: R - Creating a clustered barplot with two datasets
body: <p>I'd like to do the following in R.</p>
  
  <p>I have a group of individuals (1 - 50) with two datasets each.  Each dataset (A &amp; B) has values that can be in two categories (Gains, shown in blue; Losses, shown in red).  I'd like to show those two datasets together, as below.  The frequency of Gains/Losses would be in the y axis, where Dataset A would go upward from the x axis, and Dataset B would go downward from the x axis.  I'd like to be able to cluster the barplot either by Individual (as shown below) OR by Gains or Losses (All gains together, then all losses together).</p>
  
  <p>I know how to make clustered barplots in ggplot, but can't figure out how to combine the two datasets as in my image (with dataset A going up and dataset B going down).</p>
  
  <p><a href="https://i.stack.imgur.com/ktqCe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ktqCe.png" alt="An image of what I want"></a></p>