any_disease: Look for presence of disease

Description Usage Arguments Value Examples

Description

Look for the presence of disease over a period that follows a given time point.

Usage

1
any_disease(x, n = 1)

Arguments

x

A boolean vector informing about the presence or absence of disease at a given point in time. This implies that this vector is considered to be chronologically ordered, the most recent observations being first.

n

A integer scalar telling the number of time points after the current one to look for for defining the period of time over which we want to look for presence of disease.

Value

A boolean of vector of the same length as x, the n final values of which are NA.

Examples

1
2
3
disease <- rep(rep(c(FALSE, TRUE), 7),
               c(rep(1, 4), 2, 3, 2, 2, 1, 1, 3, 2, 2, 3))
cbind(disease, any_disease(disease, 3))

choisy/viparc documentation built on May 30, 2019, 11:38 p.m.