Skip to contents

The layers are real ggplot2 extensions: each geom_*() is a layer built on one of these, with its own default aesthetics, required aesthetics and legend glyph, so they take part in scales, guides and the position system like any geom, and can be extended with ggplot2::ggproto(). Until 0.6.0 every layer was a thin wrapper around a stock geom and borrowed its glyph.

GeomChangepoint

a vertical rule at each xintercept (geom_changepoint()); key: a vertical rule.

GeomCptSegment

a segment level (geom_cpt_segment()).

GeomCptCi

a horizontal interval with caps (geom_cpt_ci()); key: the same interval.

GeomCptRegion

a band from xmin to xmax, full height unless ymin/ymax are mapped (geom_cpt_region()); key: a shaded band.

GeomCptLabel

a labelled interval behind the series (geom_cpt_label()).

GeomCptEvent

a dotted rule with its label (geom_cpt_event()); key: a dotted rule with a flag.

StatChangepoint, StatCptRegion

detection inside the layer (stat_changepoint(), stat_cpt_region()).

Format

ggproto objects.

Examples

library(ggplot2)
class(GeomChangepoint)
#> [1] "GeomChangepoint" "GeomVline"       "Geom"            "ggproto"        
#> [5] "gg"             
GeomCptRegion$default_aes
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "steelblue"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> 0.2