plotTsAnom: Anomaly plot of time series

View source: R/plotTsAnom.R

plotTsAnomR Documentation

Anomaly plot of time series

Description

Series are illustrated by vertical lines extending from individual data values to the long-term mean. The axes are not scaled in any way. Anomaly plots are useful for visualizing shifts in time series levels.

Usage

plotTsAnom(x, xlab = NULL, ylab = NULL, strip.labels = colnames(x), ...)

Arguments

x

matrix or vector time series

xlab

optional x-axis label

ylab

optional y-axis label

strip.labels

labels for individual time series plots

...

additional options

Details

Options are passed to the underlying facet_wrap function in ggplot2. The main ones of interest are ncol for setting the number of plotting columns and scales = "free_y" for allowing the y scales of the different plots to be independent.

Value

A plot and corresponding object of class “ggplot”.

Author(s)

Alan Jassby, James Cloern

See Also

plotTs

Examples


# Spring bloom size for 6 stations in SF Bay
bloom <- aggregate(sfbayChla[, 1:6], 1, meanSub, sub=3:5)
plotTsAnom(bloom, ylab = 'Chl-a', strip.labels = paste('Station',
  substring(colnames(bloom), 2, 3)), ncol = 2, scales = "free_y")


wql documentation built on Aug. 10, 2022, 5:06 p.m.