plot
method for class "epidataCS"
either plots the
number of events along the time axis (epidataCSplot_time
) as a
hist()
, or the locations of the events in the observation region
W
(epidataCSplot_space
).## S3 method for class 'epidataCS':
plot(x, aggregate = c("time", "space"), subset, ...)epidataCSplot_time(x, subset, t0.Date = NULL, freq = TRUE,
col = rainbow(nTypes), cumulative = list(),
add = FALSE, mar = NULL, xlim = NULL, ylim = NULL,
xlab = "Time", ylab = NULL, main = NULL,
panel.first = abline(h=axTicks(2), lty=2, col="grey"),
legend.types = list(), ...)
epidataCSplot_space(x, subset,
cex.fun = sqrt, points.args = list(), add = FALSE,
legend.types = list(), legend.counts = list(), ...)
"epidataCS"
."time"
and "space"
, referring to the
specific plot functions epidataCSplot_time
and
epidataCSplot_time
, respectively.
For "time"
, the number of events over timex$events@data
, which means that column names can be referplot
-method further arguments are passed to the
aggregate
-specific plot function.
In epidataCSplot_time
, further graphical parameters are
passed to hist
t0 = x$stgrid$start[1]
as a "Date"
(or
anything coercible by as.Date
without further arguments),
enabling a nice x-axis using hist
, defaults to TRUE
.rainbow
colours.axis
(logical),
lab
(axis label), maxat
(single integer affecting
theFALSE
) indicating if the plot
should be added to an existing window.par
. The default (NULL
) is
mar <- par("mar")
, with mar[4] <- mar[2]
if an
axis is requested for the cumulative
numbers.NULL
provides automatic axis limits.legend
),
a legend for the event types is added to the plot.cex
value(s) for the sizes of the corresponding points
.
Defaults to the sqrt()
function, which for the dpoints
, specifically pch
, lwd
,
and col
, which are all recycled to give the length
nlevels(x$events$
legend
), a legend illustrating the effect of
cex.fun
is added to the plot. This list may contain a
special element counts
, which is an integaggregate="time"
(i.e., epidataCSplot_time
) the data
of the histogram (as returned by hist
),
and for aggregate="space"
(i.e., epidataCSplot_space
)
NULL
, invisibly.animate.epidataCS
data("imdepi")
## show the occurrence of events along the time axis (-> histogram)
plot(imdepi, "time", main = "Histogram of event time points")
## show the distribution in space
plot(imdepi, "space", lwd=2)
Run the code above in your browser using DataLab