Description Usage Arguments Value Author(s) References See Also Examples
The animate
-method for sts
objects
supersedes the stsplot
type observed~1|unit*time
implemented by the function stsplot_spacetime
.
Maps generated by stsplot_space
are
sequentially plotted along time (optionally showing cumulative
counts), with an optional time series chart below the map to track the
epidemic curve.
It is worth using functionality of the animation package
(e.g., saveHTML
) to directly export the
animation into a useful format.
See Meyer and Held (2014, Supplement A) for an example with the
fluBYBW
data.
1 2 3 4 5 |
object |
an object of class |
tps |
a numeric vector of one or more time points at which to plot the map.
The default |
cumulative |
logical specifying if the cumulative counts over time should be plotted. |
population,at,... |
arguments for |
timeplot |
if a list (of arguments for the internal function
|
sleep |
time to wait ( |
verbose |
logical indicating if a |
draw |
logical indicating if the produced plots at each time point should
be drawn directly (the default) or not.
The setting |
(invisibly) a list of the length(tps)
sequential plot objects
of class "\code{gtable}"
(if the the timeplot
is active) or of class
"\code{trellis"
(otherwise).
Sebastian Meyer
Meyer, S. and Held, L. (2014):
Power-law models for infectious disease spread.
The Annals of Applied Statistics, 8 (3), 1612-1639.
DOI-Link: http://dx.doi.org/10.1214/14-AOAS743
Supplement A is available from
http://www.biostat.uzh.ch/static/powerlaw/.
the other plot types documented in stsplot
for static
time series plots and maps.
1 2 3 4 5 6 7 8 9 10 | data("measlesWeserEms")
## sequential plot of the counts by region in weeks 12-16 only (for speed)
if (require("animation")) {
oldwd <- setwd(tempdir()) # to not clutter up the current working dir
saveHTML(animate(measlesWeserEms, tps=12:16, cumulative=FALSE),
title="Evolution of the measles epidemic in the Weser-Ems region",
ani.width=500, ani.height=600)
setwd(oldwd)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.