Create a date_source object as input for derive_var_extreme_dt() and
derive_var_extreme_dtm().
Arguments
- dataset_name
The name of the dataset, i.e. a string, used to search for the date.
- filter
An unquoted condition for filtering
dataset.- date
A variable providing a date. A date or a datetime can be specified. An unquoted symbol is expected.
- traceability_vars
A named list returned by
exprs()defining the traceability variables, e.g.exprs(LALVDOM = "AE", LALVSEQ = AESEQ, LALVVAR = "AESTDTC"). The values must be a symbol, a character string, a numeric, orNA.
See also
derive_var_extreme_dtm(), derive_var_extreme_dt()
Source Objects:
basket_select(),
censor_source(),
death_event,
dthcaus_source(),
event_source(),
event(),
query(),
tte_source()
Examples
# treatment end date from ADSL
trt_end_date <- date_source(
dataset_name = "adsl",
date = TRTEDT
)
# lab date from LB where assessment was taken, i.e. not "NOT DONE"
lb_date <- date_source(
dataset_name = "lb",
filter = LBSTAT != "NOT DONE" | is.na(LBSTAT),
date = LBDT
)
# death date from ADSL including traceability variables
death_date <- date_source(
dataset_name = "adsl",
date = DTHDT,
traceability_vars = exprs(
LALVDOM = "ADSL",
LALVVAR = "DTHDT"
)
)
