Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 957 Bytes

README.md

File metadata and controls

38 lines (26 loc) · 957 Bytes

lmPlot

The goal of lmPlot is to fit two variables from a given data frame into a linear model and visualize it.

The function plot_lm() takes in two arguments from the provided tibble column variables and creates a graph based on the linear model from the variables.

Installation

lmPlot is not yet on CRAN. You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("stat545ubc-2021/lmPlot")

Example

This is a basic example which shows you how to plot the linear model of two variables: cyl - Number of cylinders and mpg - Miles/(US) gallon from the mtcars data:

library(lmPlot)
plot_lm(mtcars, cyl, mpg, na.rm = T)
#> `geom_smooth()` using formula 'y ~ x'