title: How to combine two data frames into one graph where I will have two stacked bars side by side for each class?
body: <p>I registered here specifically for this purpose.</p>
  <p>Basically I have two data frames that have the exact same information but from two different years.</p>
  <p>Here the head() of one of the data frames:</p>
  <pre><code>species dbh_cm height_m         f plot dbh_m           ba
  1       1    0.7     1.34 7.1627066   16 0.007 3.848451e-05
  2       3    1.9     1.95 2.0018036   16 0.019 2.835287e-04
  3       3    4.0     3.05 0.9120516   16 0.040 1.256637e-03
  4       1    3.5     2.27 1.0072122   16 0.035 9.621128e-04
  5       3    0.6     1.52 6.9312671   16 0.006 2.827433e-05
  6       3    4.2     2.70 0.9406631   16 0.042 1.385442e-03
          volume class     Sp
  1 0.0003693754 (0,5] Spruce
  2 0.0011067593 (0,5]  Larch
  3 0.0034956596 (0,5]  Larch
  4 0.0021997474 (0,5] Spruce
  5 0.0002978850 (0,5]  Larch
  6 0.0035187332 (0,5]  Larch
  </code></pre>
  <p>For plotting the graphs for each of these I used:</p>
  <pre><code>ggplot(data=trees_b, aes(x=class, fill = Sp)) + 
    geom_bar(stat = &quot;count&quot;) +
    labs( x = &quot;DBH classes [cm]&quot;, y = &quot;Number of trees [n]&quot;, fill=&quot;Species&quot;) +
    scale_x_discrete(labels=c(&quot;(0,5]&quot; = &quot;2.5&quot;,&quot;(5,10]&quot; = &quot;7.5&quot;, &quot;(10,15]&quot; = &quot;12.5&quot;,
                              &quot;(15,20]&quot; = &quot;17.5&quot;, &quot;(20,25]&quot; = &quot;22.5&quot;, &quot;(25,30]&quot; = &quot;27.5&quot;,
                              &quot;(30,35]&quot; = &quot;32.5&quot;, &quot;(35,40]&quot; = &quot;37.5&quot;, &quot;(40,45]&quot; = &quot;42.5&quot;,
                              &quot;(45,50]&quot; = &quot;47.5&quot;, &quot;(50,55]&quot; = &quot;52.5&quot;, &quot;(55,60]&quot; = &quot;57.5&quot;,
                              &quot;(60,65]&quot; = &quot;62.5&quot;, &quot;(65,70]&quot; = &quot;67.5&quot;,&quot;(70,75]&quot; = &quot;72.5&quot;,
                              &quot;(75,80]&quot; = &quot;77.5&quot;, &quot;(80,85]&quot; = &quot;82.5&quot;)) +
    scale_fill_viridis(direction = -1, discrete = T) +
    theme(axis.text.x = element_text( size = 15),
          axis.text.y = element_text (size = 15),
          axis.title = element_text(size = 15),
          legend.text = element_text (size = 15),
          legend.title = element_text (size = 16, face = &quot;bold&quot;))
  </code></pre>
  <p>I know the code is not the cleanest but it worked out perfectly for what I needed and that is this:</p>
  <p><a href="https://i.stack.imgur.com/iyKkz.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Now I want to basically combine the two graphs into one for comparison purposes, is there a way to do that?</p>