Learn R Programming

surveillance (version 1.2-1)

[-methods: Methods for "[": Extraction or Subsetting in Package 'surveillance'

Description

Methods for "[", i.e., extraction or subsetting of the sts class in package surveillance.

Note that [<--methods methods (i.e. subassigments) are currently not supported.

drop is always FALSE.

Arguments

Examples

Run this code
data(ha)
#Convert to S4 object
shp <- system.file("shapes/berlin.shp",package="surveillance")
has4 <- aggregate(disProg2sts(ha,map=readShapePoly(shp,IDvar="SNAME")),nfreq=13)

#A suite of of simple tests (inspired by the Matrix package)
stopifnot(identical(has4, has4[]))


plot(has4[, 3])       # Single series
plot(has4[1:30, 3])   # Somewhat shorter

#Counts at time 20
plot(has4[20, ],type = observed ~1 |unit)

Run the code above in your browser using DataLab