ggplot2 - Plot rollapply with ggplot in R -


i need help. want plot barplot package ggplot represents rollapply(vector, 2, fun= "mean"). want plot looks this:

enter image description here

but bars have represent "rollmeans". code have used plot is:

    ggplot(bp12.0.5op,         aes(fecha,part.0.5))+   geom_point(na.rm=true, color="firebrick")+   geom_line(color="firebrick", size=1)+   stat_summary_bin(fun.y="mean", geom="bar")+   geom_smooth(method = "loess", se = false, linetype = 1, color = "black", size = 1 )+     geom_hline(yintercept = 15000000)+   annotate("text", min(bp12.0.5op$fecha), 15500000, label = "límite")+   ggtitle("partÍculas de 0,5micras en sala llenado bp12 operational")   geom_line(rollapply(bp12.0.5op, width = 10, fun = mean), col = 'red') 

thanks!


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -