blk.durationOfExposure: Find Duration of Exposure

View source: R/PCSmisc.R

blk.durationOfExposureR Documentation

Find Duration of Exposure

Description

Finds the total (i.e., cumulative) duration of “exposure” in a block-format data set.

Usage

blk.durationOfExposure(begin.exposure, end.exposure, id, id2 = id, diff.op = "-", fill = 0)

Arguments

begin.exposure

A vectors of times delineating when the exposure begins, in block-format with respect to id.

end.exposure

Vectors of times delineating when the exposure ends, in block-format with respect to id.

id,id2

A valid block-format ID.

diff.op

A function that computes differences between times (i.e., begin.exposure and end.exposure).

fill

A value to use when no other value is appropriate.

Details

The time intervals during which exposure occurs are specified by begin/end pairs (which cannot contain missing values). This function determines whether the total (cumulative) time of exposure for each individual in a block-format data set. Note that the time intervals may overlap.

Value

If id2 is NULL, a vector containing one value for each level of id. Otherwise, a vectors in block-format with respect to id2.

Author(s)

Benjamin Rich <mail@benjaminrich.net>

See Also

  • block-format

  • blk.concomitant


benjaminrich/PCSmisc documentation built on Feb. 11, 2024, 9:25 p.m.