plotTimeseriesStack: Plot a bunch of timeseries in a vertical stack

plotTimeseriesStackR Documentation

Plot a bunch of timeseries in a vertical stack

Description

Creates a suite of plots to characterize the results of an ensemble regression.

Usage

plotTimeseriesStack(
  plot.df,
  time.var = "year",
  color.var = "paleoData_TSid",
  invert.var = NA,
  fill.alpha = 0.2,
  line.size = 0.5,
  scale.factor = 1/3,
  scale.height = 0.75,
  lab.buff = 0.02,
  lab.size = 3,
  lab.space = 2,
  color.ramp = function(nColors) {
     RColorBrewer::brewer.pal(nColors, "Dark2")
 }
)

Arguments

plot.df

A tidy data.frame, typically the output of tidyTs()

time.var

Which variable to put on the x-axis. Must be in plot.df. Typically "year", "age", or "depth"

color.var

Which variable to color the timeseries by. The default ("paleoData_TSid") will give each timeseries it's own color. Common other options include "paleoData_variable", "archiveType", or "paleoData_units", but any variable in plot.df should work.

invert.var

Which variable to use to invert the timeseries. This should point to a variable of "positive" and "negative" (searches on "neg"), or a vector of 1s and -1s. (default = NA, which flips nothing)

fill.alpha

Transparency of the shading

line.size

thickness of the line (default = 0.5)

scale.factor

Controls how much the timeseries should overlap, with larger numbers overlapping more. (default = 1/3)

scale.height

Controls how large the y-axes will be. 1 is equivalent to end-to-end coverage with no space. (default = 0.75)

lab.buff

Fraction of the x axis to space the tick marks away from the axes bars (default = 0.02)

lab.size

Font size for the ylabels

lab.space

Multiplier on lab.buff for the axis label separation from the y-scale

color.ramp

Specify the colors to use in the plot arranged along color.var. (default = function(nColors)RColorBrewer::brewer.pal(nColors,"Dark2"))

Value

A ggplot object of the plot

Long-form example

View a full-fledged example of how to use this function.

Author(s)

Nick McKay

See Also

Other plot: plotChron(), plotChronEns(), plotChronEnsDiff(), plotCorEns(), plotHistEns(), plotLine(), plotModelDistributions(), plotPcaEns(), plotPvalsEnsFdr(), plotRegressEns(), plotScatterEns(), plotScreeEns(), plotSpectraEns(), plotSpectrum(), plotSummary(), plotSummaryTs(), plotTimeseriesEnsLines(), plotTimeseriesEnsRibbons(), plotTrendLinesEns()


nickmckay/GeoChronR documentation built on April 9, 2024, 5:26 a.m.