Learn R Programming

EGAD (version 1.0.3)

plot_densities: Plot densities

Description

The function plots multiple density curves and compares their modes

Usage

plot_densities(hists, id, col = c("lightgrey"), xlab = "", ylab = "Density", mode = "hist")

Arguments

hists
list of histogram objects or density objects
id
string
col
color for shading
xlab
string x-axis label
ylab
string y-axis label
mode
flag indicating histogram or density

Value

null

Examples

Run this code
aurocsA <- density((runif(1000)+runif(1000)+runif(1000)+runif(1000))/4)
aurocsB <- density((runif(1000)+runif(1000)+runif(1000))/3)
aurocsC <- density(runif(1000))
hists <- list(aurocsA, aurocsB, aurocsC)
temp <- plot_densities(hists,'', mode='density')

Run the code above in your browser using DataLab