loess. For datasets with 1000 or more
observations defaults to gam, see gam
for more details."In any case, loading it does allow to run method="gam" or method="loess":
ggplot(df, aes(x, y)) +
geom_point() +
geom_smooth(method="gam")
But the results are totally different from running the code without specifying the method. Which is weird.
Does anyone know what's up with this?
Well generally speaking you're right. These methods do come from the mgcv library, but they should be either implemented in ggplot or loaded with it.
From the web page of stat_smooth():
"method
- smoothing method (function) to use, eg. lm, glm, gam, loess, rlm. For datasets with n < 1000 default is
loess. For datasets with 1000 or more observations defaults to gam, seegamfor more details."In any case, loading it does allow to run method="gam" or method="loess":
ggplot(df, aes(x, y)) +
geom_point() +
geom_smooth(method="gam")But the results are totally different from running the code without specifying the method. Which is weird.
Does anyone know what's up with this?