ggdistribution: Plot distribution

Description Usage Arguments Value Examples

View source: R/fortify_stats_density.R

Description

Plot distribution

Usage

1
2
ggdistribution(func, x, p = NULL, colour = "#000000", linetype = NULL,
  fill = NULL, alpha = NULL, ...)

Arguments

func

PDF or CDF function

x

Numeric vector to be passed to func

p

ggplot2::ggplot instance to plot

colour

Line colour

linetype

Line type

fill

Fill colour

alpha

Alpha

...

Keywords passed to PDC/CDF func

Value

ggplot

Examples

1
2
3
4
5
ggdistribution(dnorm, seq(-3, 3, 0.1), mean = 0, sd = 1)
ggdistribution(ppois, seq(0, 30), lambda = 20)

p <- ggdistribution(pchisq, 0:20, df = 7, fill = 'blue')
ggdistribution(pchisq, 0:20, p = p, df = 9, fill = 'red')

Example output

Loading required package: ggplot2

ggfortify documentation built on May 29, 2017, 11:37 p.m.