Resolve delayed inputs by evaluating the code within the provided datasets
resolve.Rd
Arguments
- x
Object of class
delayed_data
to resolve.- datasets
A named list of type
data.frame
to use for evaluation.- keys
A named list of type
character
to be used as the keys for each dataset. The names of this list must be exactly the same as for datasets.
Examples
library(scda)
ADSL <- synthetic_cdisc_data("latest")$adsl
attr(ADSL, "keys") <- teal.data::get_cdisc_keys("ADSL")
data_list <- list(ADSL = shiny::reactive(ADSL))
keys <- list(ADSL = attr(ADSL, "keys"))
shiny::isolate({
# value_choices example
v1 <- value_choices("ADSL", "SEX", "SEX")
v1
teal.transform:::resolve(v1, data_list, keys)
# variable_choices example
v2 <- variable_choices("ADSL", c("BMRKR1", "BMRKR2"))
v2
teal.transform:::resolve(v2, data_list, keys)
# data_extract_spec example
adsl_filter <- filter_spec(
vars = variable_choices("ADSL", "SEX"),
sep = "-",
choices = value_choices("ADSL", "SEX", "SEX"),
selected = "F",
multiple = FALSE,
label = "Choose endpoint and Censor"
)
adsl_select <- select_spec(
label = "Select variable:",
choices = variable_choices("ADSL", c("BMRKR1", "BMRKR2")),
selected = "BMRKR1",
multiple = FALSE,
fixed = FALSE
)
adsl_de <- data_extract_spec(
dataname = "ADSL",
select = adsl_select,
filter = adsl_filter
)
teal.transform:::resolve(adsl_filter, data_list, keys)
teal.transform:::resolve(adsl_select, data_list, keys)
teal.transform:::resolve(adsl_de, data_list, keys)
# nested list (arm_ref_comp)
arm_ref_comp <- list(
ARMCD = list(
ref = variable_choices("ADSL"),
comp = variable_choices("ADSL")
)
)
teal.transform:::resolve(arm_ref_comp, data_list, keys)
})
#> $ARMCD
#> $ARMCD$ref
#> number of choices: 56
#>
#> STUDYID: Study Identifier
#> USUBJID: Unique Subject Identifier
#> SUBJID: Subject Identifier for the Study
#> SITEID: Study Site Identifier
#> AGE: Age
#> AGEU: Age Units
#> SEX: Sex
#> RACE: Race
#> ETHNIC: Ethnicity
#> COUNTRY: Country
#> DTHFL: Subject Death Flag
#> INVID: Investigator Identifier
#> INVNAM: Investigator Name
#> ARM: Description of Planned Arm
#> ARMCD: Planned Arm Code
#> ACTARM: Description of Actual Arm
#> ACTARMCD: Actual Arm Code
#> TRT01P: Planned Treatment for Period 01
#> TRT01A: Actual Treatment for Period 01
#> TRT02P: Planned Treatment for Period 02
#> TRT02A: Actual Treatment for Period 02
#> REGION1: Geographic Region 1
#> STRATA1: Stratification Factor 1
#> STRATA2: Stratification Factor 2
#> BMRKR1: Continuous Level Biomarker 1
#> BMRKR2: Categorical Level Biomarker 2
#> ITTFL: Intent-To-Treat Population Flag
#> SAFFL: Safety Population Flag
#> BMEASIFL: Response Evaluable Population Flag
#> BEP01FL: Biomarker Evaluable Population Flag
#> AEWITHFL: AE Leading to Drug Withdrawal Flag
#> RANDDT: Date of Randomization
#> TRTSDTM: Datetime of First Exposure to Treatment
#> TRTEDTM: Datetime of Last Exposure to Treatment
#> TRT01SDTM: Datetime of First Exposure to Treatment in Period 01
#> TRT01EDTM: Datetime of Last Exposure in Period 01
#> TRT02SDTM: Datetime of First Exposure to Treatment in Period 02
#> TRT02EDTM: Datetime of Last Exposure to Treatment in Period 02
#> AP01SDTM: Period 01 Start Datetime
#> AP01EDTM: Period 01 End Datetime
#> AP02SDTM: Period 02 Start Datetime
#> AP02EDTM: Period 02 End Datetime
#> EOSSTT: End of Study Status
#> EOTSTT: End of Treatment Status
#> EOSDT: End of Study Date
#> EOSDY: End of Study Relative Day
#> DCSREAS: Reason for Discontinuation from Study
#> DTHDT: Date of Death
#> DTHCAUS: Cause of Death
#> DTHCAT: Cause of Death Category
#> LDDTHELD: Elapsed Days from Last Dose to Death
#> LDDTHGR1: Last Dose to Death - Days Elapsed Grp 1
#> LSTALVDT: Date Last Known Alive
#> DTHADY: Relative Day of Death
#> ADTHAUT: Autopsy Performed
#> study_duration_secs: NOT A STANDARD BUT NEEDED FOR RCD
#>
#>
#> $ARMCD$comp
#> number of choices: 56
#>
#> STUDYID: Study Identifier
#> USUBJID: Unique Subject Identifier
#> SUBJID: Subject Identifier for the Study
#> SITEID: Study Site Identifier
#> AGE: Age
#> AGEU: Age Units
#> SEX: Sex
#> RACE: Race
#> ETHNIC: Ethnicity
#> COUNTRY: Country
#> DTHFL: Subject Death Flag
#> INVID: Investigator Identifier
#> INVNAM: Investigator Name
#> ARM: Description of Planned Arm
#> ARMCD: Planned Arm Code
#> ACTARM: Description of Actual Arm
#> ACTARMCD: Actual Arm Code
#> TRT01P: Planned Treatment for Period 01
#> TRT01A: Actual Treatment for Period 01
#> TRT02P: Planned Treatment for Period 02
#> TRT02A: Actual Treatment for Period 02
#> REGION1: Geographic Region 1
#> STRATA1: Stratification Factor 1
#> STRATA2: Stratification Factor 2
#> BMRKR1: Continuous Level Biomarker 1
#> BMRKR2: Categorical Level Biomarker 2
#> ITTFL: Intent-To-Treat Population Flag
#> SAFFL: Safety Population Flag
#> BMEASIFL: Response Evaluable Population Flag
#> BEP01FL: Biomarker Evaluable Population Flag
#> AEWITHFL: AE Leading to Drug Withdrawal Flag
#> RANDDT: Date of Randomization
#> TRTSDTM: Datetime of First Exposure to Treatment
#> TRTEDTM: Datetime of Last Exposure to Treatment
#> TRT01SDTM: Datetime of First Exposure to Treatment in Period 01
#> TRT01EDTM: Datetime of Last Exposure in Period 01
#> TRT02SDTM: Datetime of First Exposure to Treatment in Period 02
#> TRT02EDTM: Datetime of Last Exposure to Treatment in Period 02
#> AP01SDTM: Period 01 Start Datetime
#> AP01EDTM: Period 01 End Datetime
#> AP02SDTM: Period 02 Start Datetime
#> AP02EDTM: Period 02 End Datetime
#> EOSSTT: End of Study Status
#> EOTSTT: End of Treatment Status
#> EOSDT: End of Study Date
#> EOSDY: End of Study Relative Day
#> DCSREAS: Reason for Discontinuation from Study
#> DTHDT: Date of Death
#> DTHCAUS: Cause of Death
#> DTHCAT: Cause of Death Category
#> LDDTHELD: Elapsed Days from Last Dose to Death
#> LDDTHGR1: Last Dose to Death - Days Elapsed Grp 1
#> LSTALVDT: Date Last Known Alive
#> DTHADY: Relative Day of Death
#> ADTHAUT: Autopsy Performed
#> study_duration_secs: NOT A STANDARD BUT NEEDED FOR RCD
#>
#>
#>