title: Stacked-Bar Chart from a group_by Tibble Not Stacking
body: <p>I am using R and have a tibble summarizing counts of people in apprenticeships by age and race ethnicity. People are categorized as being designated as of a minority race/ethnicity or white.</p>
  
  <pre><code> RA3&lt;- structure(list(Age = c(18, 18, 19, 19, 20, 20, 21, 21, 22, 23, 
  23, 24, 24, 25, 25, 26, 26, 27, 29, 29, 31, 33, 37, 39, 39, 42, 
  47, 47, 49, 49, 50, 50, 52, 57, 57, 60, 66, 66), Minority = c("Minority", 
  "White", "Minority", "White", "Minority", "White", "Minority", 
  "White", "White", "Minority", "White", "Minority", "White", "Minority", 
  "White", "Minority", "White", "Minority", "Minority", "White", 
  "White", "White", "Minority", "Minority", "White", "Minority", 
  "Minority", "White", "Minority", "White", "Minority", "White", 
  "Minority", "Minority", "White", "White", "Minority", "White"
  ), n = c(3L, 1L, 4L, 3L, 5L, 2L, 1L, 2L, 3L, 3L, 1L, 2L, 3L, 
  8L, 2L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 2L, 1L, 1L, 2L, 3L, 5L, 1L, 
  3L, 1L, 1L, 2L, 1L, 2L, 1L, 3L, 1L)), row.names = c(NA, -38L), class = c("grouped_df", 
  "tbl_df", "tbl", "data.frame"), groups = structure(list(Age = c(18, 
  18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 26, 26, 
  27, 29, 29, 31, 33, 37, 39, 39, 42, 47, 47, 49, 49, 50, 50, 52, 
  57, 57, 60, 66, 66), Minority = c("Minority", "White", "Minority", 
  "White", "Minority", "White", "Minority", "White", "White", "Minority", 
  "White", "Minority", "White", "Minority", "White", "Minority", 
  "White", "Minority", "Minority", "White", "White", "White", "Minority", 
  "Minority", "White", "Minority", "Minority", "White", "Minority", 
  "White", "Minority", "White", "Minority", "Minority", "White", 
  "White", "Minority", "White"), .rows = list(1L, 2L, 3L, 4L, 5L, 
      6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 
      19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 
      31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L)), row.names = c(NA, 
  -38L), class = c("tbl_df", "tbl", "data.frame"), .drop = TRUE))
  </code></pre>
  
  <p>I'm trying to create a stacked bar chart in R using <code>ggplot</code>that will show both Minority/White apprenticeship counts at each age category.</p>
  
  <p>However when I run my code:</p>
  
  <pre><code>libraray(ggplot2)
  BarChartRA &lt;- ggplot(RA3, aes(x = Age, y =n, fill = Minority)) + 
    geom_bar(data = subset(RA3, Minority == "Minority"), stat = "identity", position = position_stack()) +
    geom_bar(data = subset(RA3, Minority == "White"), stat = "identity", position = position_stack()) +
    scale_fill_manual(values=c("purple","dark green"))+
    labs(x = "Age(Years)", y = "Number of OJ's", title = "Number of Registered Apprenticeships by Race/Ethnicity, Colorado, 2018")
  BarChartRA
  </code></pre>
  
  <p>I don't appear to be getting a stacked chart. </p>
  
  <p><a href="https://i.stack.imgur.com/4UXRN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4UXRN.png" alt="enter image description here"></a></p>
  
  <p>As an example, at 18 years of age (farthest left) there should be 3 Minority apprenticeships and 1 White apprenticeship for a total of 4. But as you can see, the bar chart is only showing 3. The classes are overlapping each other. </p>
  
  <p>I thought the <code>position = "stack"</code> statement in the <code>geom_bar</code>statement would resolve this.</p>
  
  <p>What am I doing wrong?</p>