I want to create a specific barplot with ggplot. So far so good, here is what I've got so far:
ggplot(only_savings, aes(DivisionName, Total_CR)) +
geom_bar(stat="summary", fun.y="sum")
As you can see - there are 2 Divisions: Electrification Products and Power Grinds. On the Y-Axis we have numeric Savings that are summed up (Total_CR - total cost reduction). BUT, I would like to SPLIT the Bar in 2 more parts: Repetitive_Savings and MDF_Savings. So it would look like this:
And here is the data: (Ok, I can't post a screenshot, so I'll paste some rows)
DivisionName Repetitive_Savings MDF_Savings Total_CR
Power Grids 86.571656 0 86.571656
Power Grids 183.461221 0 183.461221
Power Grids 2326.963118 0 2326.963118
Electrification Products 1249.323277 0 1249.323277
Electrification Products 6.849336 0 6.849336
Electrification Products 3.808845 0 3.808846
DivisionName is a factor, the other 3 are numeric Values. How can I achieve the Barplots that I've sketched in paint?