derive_var_trtdurd: Derive Total Treatment Duration (Days)

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/derive_var_trtdurd.R

Description

Derives total treatment duration (days) (TRTDURD)

Usage

1
derive_var_trtdurd(dataset, start_date = TRTSDT, end_date = TRTEDT)

Arguments

dataset

Input dataset

The columns specified by the start_date and the end_date parameter are expected.

start_date

The start date

A date or date-time object is expected.

Default: TRTSDT

end_date

The end date

A date or date-time object is expected.

Default: TRTEDT

Details

The total treatment duration is derived as the number of days from start to end date plus one.

Value

The input dataset with TRTDURD added

Author(s)

Stefan Bundfuss

See Also

derive_vars_duration()

Examples

1
2
3
4
5
6
data <- tibble::tribble(
  ~TRTSDT, ~TRTEDT,
  lubridate::ymd("2020-01-01"), lubridate::ymd("2020-02-24")
)

derive_var_trtdurd(data)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.