Good Afternoon,
I'm trying to re-create a stacked bar graph found on slide 6 of Sunlight Foundations data visualization guide (https://github.com/amycesal/dataviz-style-guide/blob/master/Sunlight-StyleGuide-DataViz.pdf). I can't seem to get the two different categories of fruit to appear side by side on the same graph. Here is what I have so far.
fruit_data <- tribble(
  ~day, ~honey_crisp, ~granny_smith, ~clementines, ~navel,
  "Monday", 3, 12, 3, 10,
  "Tuesday", 3, 9, 2, 7,
  "Wednesday", 3, 18, 4, 12,
  "Thursday", 3, 15, 3, 10,
  "Friday", 3, 3, 5, 22
)
fruit_data_long <- 
  fruit_data %>%
  pivot_longer(cols = c(honey_crisp:navel), 
               names_to = "fruit", 
               values_to = "unit") %>%
  mutate(type = if_else(fruit == "honey_crisp" | fruit == "granny_smith", "apple", "orange")) %>%
  mutate(day = factor(day, levels = c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")))
ggplot(data = fruit_data_long, 
       aes(x = day, y = unit, group = type)) +
  geom_col(aes(fill=fruit), stat="identity", position = "stack")
Any ideas?

