Learn R Programming

fifer (version 1.1)

densityPlotR: Generate a density plot using a formula

Description

Given two groups with scores on a quantitative variable, densityPlotR will draw both distributions, one for each group.

Usage

densityPlotR(formula, data = NULL, colors = NULL, ...)

Arguments

formula
a formula object where the grouping variable is on the right side of the ~ and the response variable (quantitative) is on the left side of the ~.
data
a dataset containing the variables listed in the formula
colors
a vector the same length as the number of levels of the grouping variable indicating the colors to be used for the density lines
...
other arguments passed to the plot function

See Also

boxplot, prism.plots, plotSigBars

Examples

Run this code
densityPlotR(Petal.Width~Species, data=iris)

Run the code above in your browser using DataLab