Learn R Programming

HistDat (version 0.2.0)

as.ecdf,HistDat-method: Converts this histogram to an instance of the "ecdf" class, allowing the calculation of cumulative densities, and quantiles

Description

Converts this histogram to an instance of the "ecdf" class, allowing the calculation of cumulative densities, and quantiles

Usage

# S4 method for HistDat
as.ecdf(x)

Arguments

x

An instance of the class HistDat

Value

An instance of the ecdf class. It can be invoked as a function to return the cumulative proportion of the count data less than or equal to x.

Examples

Run this code
# NOT RUN {
hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
cdf <- as.ecdf(hd)
cdf(2) # returns 0.75
# }

Run the code above in your browser using DataLab