Learn R Programming

mistr (version 0.0.6)

autoplot.dist: Autoplot of Distributions Using ggplot2

Description

The function autoplot plots the CDF and PDF of a given distribution object.

Usage

autoplot.dist(x, which = "all", ncols = 2, ...)

Value

ggplot object if which = "cdf" or which = "pdf". If both are plotted, the plots are merged using multiplot() function and a list with both plots is invisibly returned.

Arguments

x

distribution object.

which

whether to plot only CDF, PDF or both, default: 'all'.

ncols

in how many columns should the plots be merged, default: 2.

...

further arguments to be passed.

Details

The function is a wrapper of the internal plotting function plotgg. For more details see plotgg.

See Also

plotgg

Examples

Run this code
if (FALSE) {
N <- normdist()
autoplot(N)

# manipulating cdf plot
B <- binomdist(12, 0.5)
autoplot(-3*B, which = "cdf", xlim1 = c(-30, -10))
# manipulating pdf plot
autoplot(-3*B, which = "pdf", xlim2 = c(-30, -10))
}

Run the code above in your browser using DataLab