plot_twoway: Plot two variables against each other

View source: R/plot_twoway.R

plot_twowayR Documentation

Plot two variables against each other

Description

This function tries to choose a good plot to show for comparing two variables at a time.

Usage

plot_twoway(x, y, xvar, yvar, color = "lightblue", pal = "Set1")

Arguments

x

A vector.

y

A vector of the same length as 'x'.

xvar

The name of the x variable.

yvar

The name of the y variable.

color

A color to use in the plots that have one single color.

pal

A color palette to use with brewer.pal for the mosaic plots when 'x' and 'y' are factors.

Value

A plot of 'x' versus 'y'.

Author(s)

Leonardo Collado-Torres

Examples

plot_twoway(as.factor(mtcars$gear), mtcars$mpg, xvar = "gear", yvar = "mpg")


LieberInstitute/shinycsv documentation built on May 8, 2023, 7:27 p.m.