powered by
Add straight lines to a plot
type_abline(a = 0, b = 1)
the intercept and slope, single values.
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