simplePlot: simplePlot

View source: R/simplePlot.R

simplePlotR Documentation

simplePlot

Description

Generate plots for a continuous/quantitative univariate variable using the ggplot2 package

Usage

simplePlot(
  data,
  xcol,
  fill = "white",
  color = "black",
  bins = 5,
  H = TRUE,
  D = TRUE,
  B = TRUE,
  P = TRUE
)

Arguments

data

The data frame that the variable is in

xcol

The variable of interest, entered as a string

fill

The fill color of the plots, entered as a string

color

The outline color of the plots, entered as a string

bins

The number of bins for the plots, entered as a numeric value

H

Boolean operator to create histogram, default is FALSE

D

Boolean operator to create density plot, default is FALSE

B

Boolean operator to create boxplot, default is FALSE

P

Boolean operator to create freqpoly plot, default is FALSE

Value

The requested plots in ggplot2 format

Examples

simplePlot(mtcars, "wt")
simplePlot(mtcars, "wt", H = FALSE, B = FALSE, P = FALSE, color = "purple", fill = "pink")

prox9974/soc429Code documentation built on June 16, 2022, 3:41 a.m.