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:
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
Post a Comment