Plot mean or variance shifts, with uncertainties and null hypothesis testing

plotShift(
  x,
  cl.color = "Reds",
  sf.fill = c("navy", "firebrick"),
  plot.sig.vlines = FALSE,
  label.sig = FALSE,
  qs = c(0.95, 0.9),
  x.axis.label = NA,
  x.lims = NA,
  y.axis.label = NA,
  y.lims.direction = 1,
  combine.plots = TRUE,
  shift.direction = "positive/negative",
  ...
)

Arguments

x

Output from actR::detectShift (tibble)

cl.color

Color palette, single color, or vector of colors to use for confidence intervals (default = "Reds"s)

sf.fill

Color palette, single color, or vector of colors to use for confidence intervals (default = c("grey"))

plot.sig.vlines

Plot vertical lines at significant change points? (default = TRUE)

label.sig

Label significant change points (default = TRUE)

qs

significance levels to plot. The first value will be used to calculate the alpha for significant shifts (default = c(0.95,0.9))

x.axis.label

Label the x-axis (default = NA, which will automatically generate from input)

x.lims

2-element vector to use as x-axis limits (default = NA)

y.axis.label

Label the y-axis (default = NA, which will automatically generate from input)

y.lims.direction

A value of -1 will flip the y-axis for both panels (default = 1) #TODO

combine.plots

Combine the probability and timeseries plots into a single plot (TRUE)? Or return a list with each plot as a separate object (FALSE)?

shift.direction

plot positive, negative or both ("positive/negative" - the default)

...

Arguments passed on to geoChronR::plotTimeseriesEnsRibbons

add.to.plot

A ggplot object to add this plot to. Default is ggplot() .

X

A LiPD variable list to plot, including values, units, names, and more

Y

A LiPD variable list to plot, including values, units, names, and more

alp

alpha (transparency) parameter for the ribbons

probs

a vector of probabilities to plot as ribbons. It will create bands as ribbons of quantiles moving inward. If there's an odd number, it plots the middle quantile as a line.

x.bin

vector of bin edges over which to bin.

y.bin

vector of bin edges over which to bin.

n.bins

number bins over which to calculate intervals. Used to calculate x.bin if not provided.

color.low

Color of the outermost band; the extreme quantiles of the distribution

color.high

Color of the innermost band; the central quantiles of the distribution

color.line

Line color (following ggplot rules)

color.vector

A vector (of length equal to the number of bands) that specifies the colors for the ribbons from the outermost band in (default = NA). Colors specified as string according to ggplot2 conventions. If present, this overrules color.high and color.low

line.width

Width of the line

export.quantiles

If TRUE, return the plotted quantiles rather than the plot

Value

a ggplot object