plot_cor: Plot correlation between two vars

View source: R/plot_cor.R

plot_corR Documentation

Plot correlation between two vars

Description

Plots a scatter plot of x and y and includes a regression line.

Usage

plot_cor(dataset, xvar, yvar)

Arguments

dataset

a data frame or tibble

xvar

variable to plot on the x axis, as a character string. NA values are silently dropped.

yvar

variable to plot on the y axis, as a character string. NA values are silently dropped.

Value

A ggplot object which may be further customised with e.g. theme() options.

Examples

plot_cor(mtcars, "wt", "mpg")

avrincon/phdfuns documentation built on Nov. 13, 2022, 10:34 a.m.