As the title suggests, I want to combine stacked and dodge in a barplot. Most answers in Stack Overflow (e.g., this) suggest using facet wrapping. I don't want to do that because I have other graphs that do not use facet wrapping and I don't want the aesthetic to be different. The answer that is the closest to the result I want to achieve is this one. However, I would like to avoid manually creating data frames for all the dodge values.
A subset of the data I'm using is the following.
benchmark <- c("correlation", "correlation", "correlation", "covariance", "covariance", "covariance")
technique <- c("last_value", "dyna", "tage", "last_value", "dyna", "tage")
last_value_predictions <- c(1361, 1336, 453, 1865, 1841, 556)
predictions <- c(0, 25, 908, 0, 24, 1309)
df <- data.frame(benchmark, technique, last_value_predictions, predictions)
I want the benchmarks on the x axis. There should be 3 bars for each benchmark, one for each techniques (dodge). And then each bar should have the predictions stacked on top of the last value predictions.
Any help is appreciated.