Skip to contents

Intersection-over-union of two histogram supports

Usage

support_iou(h1, h2)

Arguments

h1

histogram object (as returned by graphics::hist()).

h2

histogram object (as returned by graphics::hist()).

Value

Numeric, IoU of the ranges over which h1 and h2 have non-zero counts.

Examples

h1 <- graphics::hist(rnorm(200), plot = FALSE)
h2 <- graphics::hist(rnorm(200) + 1, plot = FALSE)
support_iou(h1, h2)
#> [1] 0.8461538