gf_lm()

gf_lm()

The gf_lm() function overlays the best-fitting regression line on a scatter plot when chained onto gf_point().

Example:

# adds a regression line

gf_point(Thumb ~ Height, data = Fingers) %>%
      gf_lm( color = "orange", size = 2 )