Learn R Programming

tdigest (version 0.4.2)

tquantile: Calculate sample quantiles from a t-Digest

Description

Calculate sample quantiles from a t-Digest

Usage

tquantile(td, probs)

# S3 method for tdigest quantile(x, probs = seq(0, 1, 0.25), ...)

Value

a numeric vector containing the requested quantile values

Arguments

td

t-Digest object

probs

numeric vector of probabilities with values in range 0:1

x

numeric vector whose sample quantiles are wanted

...

unused

References

Computing Extremely Accurate Quantiles Using t-Digests

Examples

Run this code
set.seed(1492)
x <- sample(0:100, 1000000, replace = TRUE)
td <- tdigest(x, 1000)
tquantile(td, c(0, .01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.99, 1))
quantile(td)

Run the code above in your browser using DataLab