Learn R Programming

uwo4419 (version 0.3.0)

histNorm: Histogram with Density Curves Super-imposed

Description

Histogram with density curves super-imposed

Usage

histNorm(x, data, normCurve=TRUE, densCurve=FALSE, bins=30)

Arguments

x

Character string giving the name of the variable to be plotted

data

A data frame in which x can be found.

normCurve

Whether or not to impose a normal curve with same mean and SD as plotted variable (solid line).

densCurve

Whether or not to impose a smoothe density estimate of the plotted variable (dashed line).

bins

Number of bins to use in the histogram

Value

A ggplot

Examples

Run this code
# NOT RUN {
data(alberta)
alberta$age <- ifelse(alberta$age > 94, NA, alberta$age)
histNorm("age", alberta)
# }

Run the code above in your browser using DataLab