Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotTsAnom

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

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

Exploring Water Quality Monitoring Data

v0.4.9
GPL-2
Authors
Alan Jassby [aut], James Cloern [ctb], Joseph Stachelek [ctb, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.