Create a dthcaus_source
Object
Usage
dthcaus_source(
dataset_name,
filter,
date,
order = NULL,
mode = "first",
dthcaus,
traceability_vars = NULL
)
Arguments
- dataset_name
The name of the dataset, i.e. a string, used to search for the death cause.
- filter
An expression used for filtering
dataset
.- date
A date or datetime variable to be used for sorting
dataset
.- order
Sort order
Additional variables to be used for sorting the
dataset
which is ordered by thedate
andorder
. Can be used to avoid duplicate record warning.Default:
NULL
Permitted Values: list of variables or
desc(<variable>)
function calls created byexprs()
, e.g.,exprs(ADT, desc(AVAL))
orNULL
- mode
One of
"first"
or"last"
. Either the"first"
or"last"
observation is preserved from thedataset
which is ordered bydate
.- dthcaus
A variable name or a string literal --- if a variable name, e.g.,
AEDECOD
, it is the variable in the source dataset to be used to assign values toDTHCAUS
; if a string literal, e.g."Adverse Event"
, it is the fixed value to be assigned toDTHCAUS
.- traceability_vars
A named list returned by
exprs()
listing the traceability variables, e.g.exprs(DTHDOM = "DS", DTHSEQ = DSSEQ)
. The left-hand side (names of the list elements) gives the names of the traceability variables in the returned dataset. The right-hand side (values of the list elements) gives the values of the traceability variables in the returned dataset. These can be either strings or symbols referring to existing variables.
See also
Source Objects:
basket_select()
,
censor_source()
,
date_source()
,
death_event
,
event_source()
,
event()
,
query()
,
tte_source()
Examples
# Deaths sourced from AE
src_ae <- dthcaus_source(
dataset_name = "ae",
filter = AEOUT == "FATAL",
date = AEDTHDT,
mode = "first",
dthcaus = AEDECOD
)
# Deaths sourced from DS
src_ds <- dthcaus_source(
dataset_name = "ds",
filter = DSDECOD == "DEATH",
date = DSSTDT,
mode = "first",
dthcaus = DSTERM
)