Learn R Programming

fitteR (version 0.2.0)

ecdf2: Calculate cumulative density

Description

Calculates the cumulative density of a set of numeric values.

Usage

ecdf2(x, y = NULL)

Arguments

x

A numeric vector of which the ECDF should be calculated

y

A numeric vector. See details for explanation

Value

A list

Details

This function extends the functionality of of the standard implementation of ECDF. Sometimes it is desireable to get the ECDF from pre-tabulated values. For this, elements in x and y have to be linked to each other.

See Also

ecdf for the standard implementation of ECDF

Examples

Run this code
# NOT RUN {
x <- rnorm(1000)
e <- ecdf2(x)
str(e)
plot(e)
plot(e$x, e$cs)

x <- sample(1:100, 1000, replace=TRUE)
plot(ecdf2(x))
tab <- table(x)
x <- unique(x)
lines(ecdf2(x, y=tab), col="green")
# }

Run the code above in your browser using DataLab