Last data update: 2014.03.03

R: Empirical Cumulative Distribution Function From a Histogram.
HistToEcdfR Documentation

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.

Author(s)

Murray Stokely mstokely@google.com

See Also

histogramtools-package, ecdf, approxfun, and hist.

Examples

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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HistogramTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HistogramTools/ecdfofhist.Rd_%03d_medium.png", width=480, height=480)
> ### Name: HistToEcdf
> ### Title: Empirical Cumulative Distribution Function From a Histogram.
> ### Aliases: HistToEcdf
> ### Keywords: manip utilities
> 
> ### ** Examples
> 
> h <- hist(runif(100), plot=FALSE)
> plot(HistToEcdf(h))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>