Learn R Programming

distributional (version 0.2.1)

autoplot.distribution: Plot a distribution

Description

deprecated

Usage

# S3 method for distribution
autoplot(
  x,
  type = c("pdf", "cdf"),
  n = 100,
  quantile_range = c(0.001, 0.999),
  ...
)

Arguments

x

The distribution(s) to plot.

type

The type of plot to make (must be either "pdf" or "cdf").

n

The resolution (number of points) used to display the distribution.

quantile_range

The range of the distribution (specified as quantiles).

...

Unused.

Details

Visualise distribution(s) by plotting its probability density function (density()) or cumulative distribution function (cdf()). Note: This function currently only works for continuous distributions.

Examples

Run this code
# NOT RUN {
library(ggplot2)
dist <- c(dist_normal(mu = 0, sigma = 1), dist_student_t(df = 3))
autoplot(dist, type = "pdf")
autoplot(dist, type = "cdf")

# }

Run the code above in your browser using DataLab