sts_observation: Create an 'sts' object with a given observation date

Description Usage Arguments Examples

View source: R/sts_observation.R

Description

Function for creating an sts object with a given observation date.

Usage

1
sts_observation(sts, dateObservation, cut = TRUE)

Arguments

sts

sts-object we want to set at a previous state. Needs to include a reporting triangle.

dateObservation

Date for which we want the state. Needs to be in the reporting triangle dates.

cut

Boolean indicating whether to have 0 counts after the observation date or to simply cut the sts-object

Examples

1
2
3
4
5
data("salmAllOnset")
salmAllOnsety2013m01d20 <- sts_observation(salmAllOnset,
dateObservation="2014-01-20",cut=FALSE)
plot(salmAllOnset)
lines(salmAllOnsety2013m01d20@observed,t="h",col="red")

Example output

Loading required package: sp
Loading required package: xtable
This is surveillance 1.17.0. For overview type 'help(surveillance)'.

surveillance documentation built on March 31, 2021, 9:08 a.m.