Learn R Programming

tinyplot (version 0.3.0)

type_abline: Add straight lines to a plot

Description

Add straight lines to a plot

Usage

type_abline(a = 0, b = 1)

Arguments

a, b

the intercept and slope, single values.

Examples

Run this code
mod = lm(mpg ~ hp, data = mtcars)
y = mtcars$mpg
yhat = predict(mod)
tinyplot(y, yhat, xlim = c(0, 40), ylim = c(0, 40))
tinyplot_add(type = type_abline(a = 0, b = 1))

Run the code above in your browser using DataLab