Learn R Programming

surveillance (version 1.5-4)

twinstim_epidataCS_plot: Plotting the Events of an Epidemic over Time and Space

Description

The plot method for class "epidataCS" either plots the number of events along the time axis (aggregated over space) using hist(), or the locations of the events in the observation region W (aggregated over time).

Usage

## S3 method for class 'epidataCS':
plot(x, aggregate = c("time", "space"), subset, ...)

Arguments

x
an object of class "epidataCS".
aggregate
character, one of "time" and "space". If "time", the number of events over time is plotted using the function hist (or his
subset
logical expression indicating a subset of events to consider for plotting: missing values are taken as false. Note that the expression is evaluated in the events data frame x$events@data, which means that column names can be refer
...
The following graphical parameters are available depending on the value of aggregate. For plotting the number of events over time (aggregate = "time"): [object Object],[object Object],[object Object],[object Obje

Value

  • For aggregate = "time" the data of the histogram (as returned by hist), for aggregate = "space" NULL, invisibly.

See Also

animate.epidataCS

Examples

Run this code
data("imdepi")

## show the occurrence of events along the time axis (-> histogram)
plot(imdepi, aggregate = "time", subset = type == "B",
     main = "Time series of events of the serogroup B finetype")

## show the distribution in space
plot(imdepi, aggregate = "space", colTypes = 1:2)

Run the code above in your browser using DataLab