plotDensity: Plot Densities

View source: R/plotDensity.R

plotDensityR Documentation

Plot Densities

Description

Plot multiple density functions on same graph

Usage

plotDensity(
  density_ls,
  colors_ls = brewer.pal(8, "Dark2"),
  main_v = "",
  x_v = "",
  names_v = NULL,
  lwd_v = 2
)

Arguments

density_ls

list of either densities or vectors

colors_ls

list of colors one for each element of density_ls

main_v

character vector for title

x_v

character vector for x-axis

names_v

names to plot to legend. If NULL, will use names of density_ls.

lwd_v

line width

Value

print density plot to console

Examples

set.seed(1)
d_ls <- list("A" = rnorm(1000), "B" = rnorm(1000, mean = 2, sd = 1), "C" = rnorm(1000, mean = -1, sd = 0.5))
plotDensity(d_ls)

weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.