Learn R Programming

HistogramTools (version 0.3.2)

HistToEcdf: Empirical Cumulative Distribution Function From a Histogram.

Description

Computes an approximate empirical cumulative distribution function of a data set given a binned histogram representation of that dataset.

Usage

HistToEcdf(h, method="constant", f=0, inverse=FALSE)

Arguments

h
A histogram object (created by hist) representing a pre-binned dataset on which we'd like to calculate an ECDF.
method
specifies the interpolation method to be used in call to approxfun(). Choices are "linear" or "constant".
f
if method="constant" a number between 0 and 1 inclusive, indicating a compromise between left- and right-continuous step functions. See ?approxfun
inverse
if TRUE return the inverse Ecdf.

Details

This function approximates the e.c.d.f. (empirical cumulative distribution function) of a data set given a binned histogram representation of that data set.

See Also

histogramtools-package, ecdf, approxfun, and hist.

Examples

Run this code
h <- hist(runif(100), plot=FALSE)
plot(HistToEcdf(h))

Run the code above in your browser using DataLab