addlmeq: Add Linear Fitting Equation

View source: R/addlmeq.R

addlmeqR Documentation

Add Linear Fitting Equation

Description

addlmeq produces an equation expression for a simple linear fitting to be added in a plot.

Usage

addlmeq(fit, decimal = 2)

Arguments

fit

an object of class "lm" produced by simple linear models.

decimal

displayed decimal places.

Value

An equation expression for the given simple linear fitting.

See Also

addr2.

Examples

fit = lm(dist ~ speed, data = cars)
plot(cars)
abline(fit, col = 'red')
title(addlmeq(fit, 2), adj = 0.1, line = -1.8, col.main = 'blue', cex.main = 1.1)

jiachengzhao/smot documentation built on Sept. 20, 2022, 6:36 a.m.