add_regime_shift_highlight: Highlight specific time spans

Description Usage Arguments Details Value

View source: R/plotting_helpers.R

Description

Add transparent vertical slices, with boundaries specified by the lower_date and upper_date arguments.

Usage

1
2
3
4
add_regime_shift_highlight(my_plot, lower_date = as.Date(c("1983-11-12",
  "1990-01-06", "1998-12-22", "2009-05-23")),
  upper_date = as.Date(c("1985-03-16", "1992-04-04", "1999-11-06",
  "2011-01-05")), alpha = 0.5, fill = "grey30")

Arguments

my_plot

the original ggplot object

lower_date

a vector of the beginnings of the time spans

upper_date

a vector of the ends of the time spans

alpha

the transparency of the bars to add to the plot

fill

the fill color of the bars to add to the plot

Details

The default values for the time spans correspond to the 0.90 credibility intervals estimated from https://weecology.github.io/LDATS/paper-comparison.html. An alternative default are the values from Christensen et al. 2018: lower_date = as.Date(c("1983-12-01", "1988-10-01", "1998-09-01", "2009-06-01")) upper_date = as.Date(c("1984-07-01", "1996-01-01", "1999-12-01", "2010-09-01"))

Value

A ggplot object with the bars added


ha0ye/portalDS documentation built on March 28, 2020, 1:21 p.m.