cdf {mmstat4}R Documentation

Generates and plots a cumulative distribution function.

Description

Generates and plots a cumulative distribution function.

Usage

cdf(x, ...)

## Default S3 method:
cdf(x, y, discrete = TRUE, ...)

## S3 method for class 'cdf'
plot(x, y, ..., col.01line = "black", pch = 19)

Arguments

x

numeric: x-values

...

further parameters given to graphics::plot()

y

numeric: y-values

discrete

logical: if distribution is discrete

col.01line

color: color of horizontal lines at 0 and 1 (default: black)

pch

point type: See graphics::points() for possible values and their interpretation (default: 19)

Value

returns a cdf object

Examples

# Binomial distribution
x <- cdf(0:10, pbinom(0:10, 10, 0.5))
plot(x)
# Exponential distribution
x <- seq(0, 5, by=0.01)
x <- cdf(x, pexp(x), discrete=FALSE)
plot(x)

[Package mmstat4 version 0.2.1 Index]