lp_scatter_by_target: Scatterplots of one variable vs many others

View source: R/scatter_by_target.R

lp_scatter_by_targetR Documentation

Scatterplots of one variable vs many others

Description

This function plots a multi-panel scatterplot where many variables are plotted against a target variable

Usage

lp_scatter_by_target(
  .data,
  target = NULL,
  ...,
  width = 25,
  .cor_method = "pearson",
  .smouth = "lm",
  .scales = c("free_y", "free", "fixed", "free_x")
)

Arguments

.data

The dataframe

target

The target variable to plot scatter against all other vars

...

The variables to use. DPLYR style. Supports dplyr::everything()

width

The width of the labeller function in the strips. Defaults t0 25

.cor_method

The correlation method. One of "pearson", "kendall", spearman". Defaults to "pearson"

.smouth

The smooth method for the graphs. All option available in the ggplot2::geom_smouth()

.scales

Character. The scales arg of ggplot2::facet_wrap(). One of c("fixed", "free","free_x", "free_y"). Defaults to "fixed"

Value

A ggplot object

Examples

lp_scatter_by_target(mtcars, target = mpg, disp:wt)

lefkiospaikousis/lpmisc documentation built on July 19, 2022, 3:16 a.m.