Binning highest density regions in one or two dimensions

hdr_bin(x, y = NULL, prob = c(0.5, 0.9, 0.99), ...)

Arguments

x

Numeric vector

y

Numeric vector of same length as x.

prob

Probability coverage required for HDRs

...

...

Value

probability coverage for each element of the numeric vectors.

Examples

library(ggplot2)

ggplot(data = faithful, aes(x = waiting, y = eruptions)) +
  geom_point(aes(colour = hdr_bin(x = waiting, y = eruptions)))