I want to plot corresponding pctg
in an additive way. stock_exhaustion
is level of exhaustion of stock.
Exemple, what I have actually :
stock_exhaustion Type_product sm pctg
(0,10] C 13. 5.78
(10,20] C 20. 8.89 ..
I want to transform it into
stock_exhaustion Type_product sm pctg
(0,10] C 13. 5.78
(10,20] C 20. 5.78 + 8.89 ..
Is it possible with ggplot ? or should I reshape my table :in this case I have no idea how to indicate to R to sum with the precedent interval
this is mydataset
res=structure(list(stock_exhaustion = structure(c(1L, 1L, 1L,
1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 6L,
6L, 6L, 6L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 10L,
10L, 10L), .Label = c("(0,10]", "(10,20]", "(20,30]", "(30,40]",
"(40,50]", "(50,60]", "(60,70]", "(70,80]", "(80,90]", "(90,100]"
), class = "factor"), Type_product = c("C", "F", "M",
"S", "C", "F", "M", "S", "C", "F",
"S", "C", "F", "S", "C", "F", "M",
"S", "C", "F", "M", "S", "C", "F",
"M", "S", "C", "F", "M", "S", "C",
"F", "M", "C", "F", "M"), somme = c(13,
29, 1, 7, 20, 24, 2, 5, 13, 37, 3, 16, 32, 3, 25, 27, 1, 1, 25,
22, 2, 1, 33, 14, 3, 1, 29, 19, 4, 1, 33, 9, 9, 18, 9, 25), pctg = c(5.77777777777778,
13.0630630630631, 2.08333333333333, 38.8888888888889, 8.88888888888889,
10.8108108108108, 4.16666666666667, 27.7777777777778, 5.77777777777778,
16.6666666666667, 16.6666666666667, 7.11111111111111, 14.4144144144144,
16.6666666666667, 11.1111111111111, 12.1621621621622, 2.08333333333333,
5.55555555555556, 11.1111111111111, 9.90990990990991, 4.16666666666667,
5.55555555555556, 14.6666666666667, 6.30630630630631, 6.25, 5.55555555555556,
12.8888888888889, 8.55855855855856, 8.33333333333333, 5.55555555555556,
14.6666666666667, 4.05405405405405, 18.75, 8, 4.05405405405405,
52.0833333333333)), .Names = c("stock_exhaustion", "Type_product",
"somme", "pctg"), row.names = c(NA, -36L), vars = "stock_exhaustion", drop = TRUE, class = c("grouped_df",
"tbl_df", "tbl", "data.frame"))