plot_mpg: Plot the mpg dataset's displ and hwy variable

Description Usage Arguments Value Examples

View source: R/plot-mpg.R

Description

This funciton provides a way for plotting mpg dataset's displ and hwy with different facet and colour variable using ggplot2 package.

Usage

1
plot_mpg(colour_var = NULL, facet_var = NULL)

Arguments

colour_var

A variable name as a string to use as a mapping in ggplot2::aes() for the colour aesthetic, or NULL to suppress.

facet_var

A variable name as a string to use as in ggplot2::facet_wrap() for the colour aesthetic, or NULL to skip facetting.

Value

A ggplot2::ggplot() object.

Examples

1
2
3
plot_mpg("class", "drv")
plot_mpg(NULL, "drv")
plot_mpg(NULL, NULL)

shafayetShafee/plotmpg documentation built on Dec. 23, 2021, 1:17 a.m.