Introductory guide to the art and science of data visualisation. Insights, advice, and examples (with code) to make data outputs more readable, accessible, and impactful.
# Adding linear OLS regression fit of y~x.gg <- gg + geom_smooth(method = "loess", color = "firebrick", se = FALSE)
Since the geom_smooth is not a linear OLS regression fit of y~x, I think you would want to adjust either the comment or the smooth. itself. Since the plot looks nice, it is probably the comment
On the page https://royal-statistical-society.github.io/datavisguide/docs/principles.html there is a comment line followed by a geom_smooth:
# Adding linear OLS regression fit of y~x.
gg <- gg + geom_smooth(method = "loess", color = "firebrick", se = FALSE)
Since the geom_smooth is not a linear OLS regression fit of y~x, I think you would want to adjust either the comment or the smooth. itself. Since the plot looks nice, it is probably the comment