Learn R Programming

HistogramTools (version 0.3.2)

IntersectHistograms: Intersect Histograms

Description

Takes two histograms with identical bucket boundaries and returns a histogram of the intersection of the two. Each bucket of the returned histogram contains the minimum of the equivalent buckets in the two provided histograms.

Usage

IntersectHistograms(h1, h2)

Arguments

h1,h2
"histogram" objects (created by hist) representing a dataset summarized by binning.

References

Swain, Michael J., and Dana H. Ballard. "Color indexing." International journal of computer vision 7.1 (1991): 11-32.

See Also

histogramtools-package, hist.

Examples

Run this code
h1 <- hist(runif(100), plot=FALSE)
h2 <- hist(runif(100), plot=FALSE)
plot(IntersectHistograms(h1, h2))

Run the code above in your browser using DataLab