chem_scatter: Creates a scatterplot with regression line

View source: R/chem_scatter.R

chem_scatterR Documentation

Creates a scatterplot with regression line

Description

Creates a scatterplot with regression line

Usage

chem_scatter(data, xvar, yvar, xlab = "Insert X-axis label",
  ylab = "Insert Y-axis label", intercept = NULL, reg_line = TRUE)

Arguments

data

A data frame containing variables to be plotted

xvar

The name of the x-variable

yvar

The name of the y-variable

xlab

A string containing the x-axis label

ylab

A string containing the y-axis label

intercept

Set to NULL by default, but can be changed to a numeric value to force the regression to through a specified y-value. For example, intercept = 0 forces the regression line to go through origin

reg_line

Set to TRUE by default to show the regression line. If set to FALSE no regression line will appear showing only the points

Value

A plot

Examples

## Not run: 
 chem_scatter(iris, Sepal.Width, Sepal.Length)

## End(Not run)

ismayc/chemistr documentation built on Feb. 4, 2023, 12:44 p.m.