geom_lm | R Documentation |
Convenience function- a version of 'geom_smooth()' using 'lm()' instead of 'loess()'
geom_lm(formula = y ~ x, se = TRUE, linewidth = 1, ...)
formula |
y~x for most |
se |
Plot error range (T/F) |
linewidth |
width of regression line |
... |
pass additional arguments |
a ggplot object
library(dplyr)
library(ggplot)
Orange %>%
ggplot(aes(age, circumference)) +
geom_lm(alpha = 0.5, color = "steelblue") +
geom_point()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.