ccr.multDensPlot: Mutiple shaded density plot

View source: R/CRISPRcleanR.R

ccr.multDensPlotR Documentation

Mutiple shaded density plot

Description

This functions plots multiple distribution densities with solid colors for the curves and shaded colors for underlying areas.

Usage

ccr.multDensPlot(TOPLOT, COLS,
                 XLIMS, TITLE, LEGentries, XLAB)

Arguments

TOPLOT

A list of density object computed using the density function of the stats package.

COLS

A vector of colors of the same length of TOPLOT that are used to plot the density curves. Alpha-reduced versions of these colors are used to fill the underlying areas.

XLIMS

A vector of two numerical values optionally specifying x-axis limits (NULL by default).

TITLE

A string containing the plot title.

LEGentries

A vector of strings (one per each density in TOPLOT) specifying corresponding legend entries.

XLAB

A string containing the x-axis label.

Author(s)

Francesco Iorio (francesco.iorio@fht.org)

Examples

## generating random data
x <- rnorm(1000, 0, 0.5)
y <- rnorm(1000, 2, 0.4)
z <- rnorm(1000, -1, 1.5)


## assembling kernel estimated distributions into a list
ToPlot<-list(x=density(x),y=density(y),z=density(z))

## density visualisation
ccr.multDensPlot(ToPlot,COLS = c('red','blue','gray'),
    TITLE = 'example',LEGentries = c('x','y','z'),
    XLIMS = c(-5,3))

francescojm/CRISPRcleanR documentation built on April 30, 2023, 5:41 a.m.