This vignette serves as a temporary repository of the currently available standard components inside {mighty.component}.
ady: Analysis relative day
type: derivation
Derives the relative day compared to the treatment start date.
aendt: Analysis end date
type: derivation
Derives analysis end date based on (incomplete) dates given as character
Parameters
| name | description |
|---|---|
| domain |
character Name of new domain being
created |
| dtc |
character Name of date variable |
Code
{{domain}} <- {{domain}} |>
dplyr::mutate(
AENDT = admiral::convert_dtc_to_dt(
dtc = {{dtc}},
highest_imputation = "M",
date_imputation = "last"
),
AENDTF = admiral::compute_dtf(
dtc = {{dtc}},
dt = AENDT
)
)assign: Assign
type: assigned
Assigns a single value to an entire column.
astdt: Analysis start date
type: derivation
Derives analysis start date based on (incomplete) dates given as character
Parameters
| name | description |
|---|---|
| domain |
character Name of new domain being
created |
| dtc |
character Name of date variable |
Code
{{domain}} <- {{domain}} |>
dplyr::mutate(
ASTDT = admiral::convert_dtc_to_dt(
dtc = {{dtc}},
highest_imputation = "M",
date_imputation = "first"
),
ASTDTF = admiral::compute_dtf(
dtc = {{dtc}},
dt = ASTDT
)
)predecessor: Predecessor
type: predecessor
Creates new column(s) based on a predecessor column(s).
supp_sdtm: Add Supplementary Variable from SDTM
type: predecessor
Add a variable from a supplementary SDTM domain.
Parameters
| name | description |
|---|---|
| domain |
character Name of new domain being
created |
| source |
character Name of the supplementary data
set to use |
| qnam |
character Name of qualifier(s) to add from
source
|
Depends
| domain | column |
|---|---|
| {{domain}} | USUBJID |
| {{source}} | USUBJID |
| {{source}} | IDVAR |
| {{source}} | IDVARVAL |
| {{source}} | QNAM |
| {{source}} | QVAL |
Code
idvar <- unique({{source}}[["IDVAR"]])
idclass <- class({{domain}}[[idvar]])
idfunc <- get(paste0("as.", idclass))
supp_data <- {{source}} |>
dplyr::select(USUBJID, IDVAR, IDVARVAL, QNAM, QVAL) |>
tidyr::pivot_wider(names_from = QNAM, values_from = QVAL) |>
dplyr::mutate(IDVARVAL = idfunc(IDVARVAL)) |>
dplyr::select(USUBJID, IDVARVAL, {{qnam}})
{{domain}} <- {{domain}} |>
dplyr::left_join(
y = supp_data,
by = dplyr::join_by(USUBJID, !!idvar == IDVARVAL)
)trtemfl: Treatment-emergent flag
type: derivation
Derives treatment emergent analysis flag.
Parameters
| name | description |
|---|---|
| domain |
character Name of new domain being
created |
| end_window | Passed along to admiral::end_window()
|
Code
{{domain}} <- {{domain}} |>
admiral::derive_var_trtemfl(
start_date = ASTDT,
end_date = AENDT,
trt_start_date = TRTSDT,
trt_end_date = TRTEDT,
end_window = {{end_window}}
)