[-methods {surveillance}R Documentation

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.

Methods

There are more than these:

x = "sts", i = "missing", j = "missing", drop= "ANY"
...
x = "sts", i = "numeric", j = "missing", drop= "missing"
...
x = "sts", i = "missing", j = "numeric", drop= "missing"
...

Examples

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)


[Package surveillance version 1.1-2 Index]