Description Usage Arguments Details Author(s) See Also Examples
Approximate the quantiles of the underlying distribution for which only a histogram is available.
1 2 3 | ApproxQuantile(x, probs, ...)
ApproxMean(x)
Count(x)
|
x |
A histogram object (created by |
probs |
Numeric vector of probabilities with values in [0,1]. |
... |
Any other arguments to pass to |
Many data analysis pipelines write out histogram protocol buffers with
thousands of buckets so as to be applicable in a wide range of
contexts. This function provides a way to transform the histogram into
approximations of the quantile, median, mean, etc of the underlying
distribution. Count(x)
returns the number of
observations in the histogram.
Murray Stokely mstokely@google.com
histogramtools-package
and
hist
.
1 2 3 4 5 | x <- hist(c(1,2,3), breaks=c(0,1,2,3,4,5,6,7,8,9), plot=FALSE)
Count(x)
ApproxMean(x)
ApproxQuantile(x, .5)
ApproxQuantile(x, c(.05, .95))
|
[1] 3
[1] 1.5
50%
1.5
Warning message:
In ApproxQuantile(x, 0.5) :
Quantiles computed for histograms with fewer than 100 buckets may be inaccurate. Consider using histograms with more granular buckets.
5% 95%
0.6 5.1
Warning message:
In ApproxQuantile(x, c(0.05, 0.95)) :
Quantiles computed for histograms with fewer than 100 buckets may be inaccurate. Consider using histograms with more granular buckets.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.