Plot Methods for Surveillance Time-Series Objects
stsplot.RdThis page gives an overview of plot types
for objects of class "sts".
Usage
# S4 method for class 'sts,missing'
plot(x, type = observed ~ time | unit, ...)Arguments
- x
an object of class
"sts".- type
see Details.
- ...
arguments passed to the
type-specific plot function.
Details
There are various types of plots which can be produced from an
"sts" object. The type argument specifies the desired
plot as a formula, which defaults to observed ~ time | unit,
i.e., plot the time series of each unit separately.
The observed term on the left-hand side can also be omitted;
it is used by default. Arguments to
specific plot functions can be passed as further arguments (...).
The following list describes the plot variants:
observed ~ time | unitThe default type shows
ncol(x)plots, each containing the time series of one observational unit. The actual plotting per unit is done by the functionstsplot_time1, called sequentially fromstsplot_time.
A ggplot2-based alternative for this type of plot is provided through anautoplot-method for"sts"objects.observed ~ timeThe observations in
xare firstaggregatedover units and the resulting univariate time-series is plotted via the functionstsplot_time.alarm ~ timeGenerates a so called alarmplot for a multivariate
stsobject. For each time point and each series it is shown whether there is an alarm (so it actually showsalarm ~ time | unitand thistypeworks as well). In case of hierarchical surveillance the user can pass an additional argumentlvl, which is a vector of the same length as rows inxspecifying for each time series its level.observed ~ unitproduces a map of counts (or incidence) per region aggregated over time. See
stsplot_spacefor optional arguments, details and examples.
See also
the documentation of the individual plot types
stsplot_time, stsplot_space,
as well as the animate method.