Description Usage Arguments Details Author(s) See Also Examples
Merge adjacent buckets in a histogram and return a new histogram.
1 | MergeBuckets(x, adj.buckets=NULL, breaks=NULL, FUN=sum)
|
x |
A histogram object (created by |
adj.buckets |
The number of adjacent buckets to merge together. |
breaks |
If |
FUN |
The user defined function that should be run to merge the counts of adjacent buckets in the histogram. |
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 one with fewer buckets.
Murray Stokely mstokely@google.com
histogramtools-package
and
hist
.
1 2 3 4 5 |
$breaks
[1] 0 1 2 3 4 5 6 7 8 9
$counts
[1] 1 1 1 0 0 0 0 0 0
$density
[1] 0.3333333 0.3333333 0.3333333 0.0000000 0.0000000 0.0000000 0.0000000
[8] 0.0000000 0.0000000
$mids
[1] 0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5
$xname
[1] "c(1, 2, 3)"
$equidist
[1] TRUE
attr(,"class")
[1] "histogram"
$breaks
[1] 0 2 4 6 8 9
$counts
[1] 2 1 0 0 0
$density
[1] 0.3333333 0.1666667 0.0000000 0.0000000 0.0000000
$mids
[1] 1.0 3.0 5.0 7.0 8.5
$xname
[1] "c(1, 2, 3)"
$equidist
[1] FALSE
attr(,"class")
[1] "histogram"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.