This question is related to this one.
I'm trying to use loess()
inside ggplot2
's stat_smooth()
, this way :
ggplot(data = mydf, aes(x=time, y=pdm, z=surface))
+ geom_point() + stat_smooth(col="red")
+ stat_quantile(formula = loess(mydf$pdm ~ mydf$time), quantiles = c(0.25, 0.5, 0.75))
However, I get the following error message :
Warning messages:
1: 'newdata' had 100 rows but variables found have 6816 rows
2: Computation failed in 'stat_quantile()':
replacement has 6816 rows, data has 100
Any idea of what is going on / how to get it to work ?
Thanks