plt_regression_line: ggplot2: Add a regression line to a scatter plot

View source: R/plt_regression_line.R

plt_regression_lineR Documentation

ggplot2: Add a regression line to a scatter plot

Description

Add a regression line to a ggplot2 scatter plot.

Usage

plt_regression_line(color = "black", linetype = "dashed", linewidth = 0.75)

Arguments

color

A character single value (default = 'black'), that will be the line color

linetype

A character single value (default = 'dashed'), that will be the line type

linewidth

A numeric single value (default = 0.75), that will be the line width

Value

A ggplot2 object.

Examples


library(ggplot2)

plot <-
  ggplot(mtcars,aes(qsec,mpg))+
  geom_point()

plot

plot + plt_regression_line()


vbfelix/relper documentation built on May 10, 2024, 10:50 p.m.