gghdr: High Density Region plots.

Description Usage Arguments Value Author(s) References Examples

Description

High density region (HDR) boxplots are a variation of boxplots. HDR plots are based on a density estimate of the marginal distribution. Cutoff values for the probability are defined in the parameter probs to define regions. In a uni-modal situation, the HDR plots with probability probs=0.25 show the boxes of a regular boxplot. The code is based on the hdrcde package by hyndman, who also introduced the plots.

Usage

1
gghdr(data, x, y, probs = c(90, 50, 25), fill = "grey50", ...)

Arguments

data

dataset

x

factor variable

y

values

probs

vector of probabilities as cut-offs for the density regions

fill

fill color of highest density regions. Either a color description (name or hex string), or grouping variable.

...

other parameters passed on to the ggplot2 framework

Value

ggplot2 layer of highest density region boxplots.

Author(s)

Heike Hofmann

References

hyndman

Examples

1
2
3
4
5
6
require(ggplot2)
data(diamonds)
gghdr(diamonds, color, price)
gghdr(diamonds, cut, price, probs=c(50,25,12.5, 6.25), fill=cut) +
  scale_fill_brewer(palette="Set1") +
  scale_colour_brewer(palette="Set1")

heike/ggboxplots documentation built on May 17, 2019, 3:23 p.m.