"epidata"
. This only works with 1- or 2-dimensional coordinates
and is not useful if some individuals share the same coordinates
(overlapping). There are two types of animation, see argument
time.spacing
. Besides the direct plotting in the Rsession, it is
also possible to generate a sequence of graphics files to create animations
outside R.## S3 method for class 'summary.epidata':
animate(object, main = "An animation of the epidemic",
pch = 19, col = c(3, 2, gray(0.6)), time.spacing = NULL,
sleep = quote(5/.nTimes), legend.opts = list(), timer.opts = list(),
end = NULL, generate.snapshots = NULL, ...)## S3 method for class 'epidata':
animate(object, ...)
"epidata"
or
"summary.epidata"
. In the former case, its summary is calculated
and the function continues as in the latter case, passing all ...
arguments to the summ
title
.NULL
(the default), the
events are plotted one by one with pauses of sleep
seconds. Thus,
it is just the ordering of the events, which is shown. To plot
the appeaSys.sleep
before the next plotting
event. By default, each artificial pause is of length 5/.nTimes
seconds, where .nTimes
is the number of events (inflegend
function or
NULL
(or NA
), in which case no legend will be plotted. All
necessary arguments have sensible defaults and need legend
function or
NULL
(or NA
), in which case no timer will be plotted. All
necessary arguments have sensible defaults and need ntime.spacing
not being
NULL
. By default (NULL
), time stops after the last event.NULL
(the default) or a list of arguments passed to function
dev.print
, which then is executed at each time point of the
grid defined by time.spacing
. Note that this onlplot
, e.g.
las
, cex.axis
(etc.) and mgp
.summary.epidata
for the data, on which the plot is based.
plot.epidata
for plotting the evolution of an epidemic by
the numbers of susceptible, infectious and removed individuals.data("fooepidata")
s <- summary(fooepidata)
# plot the ordering of the events only
animate(s) # or animate(fooepidata)
# with timer
animate(s, time.spacing = 0.1)
Run the code above in your browser using DataLab