diff --git a/book/graphs/efficacy/fstg01.qmd b/book/graphs/efficacy/fstg01.qmd index 02ef1d0e99..ae1786849e 100644 --- a/book/graphs/efficacy/fstg01.qmd +++ b/book/graphs/efficacy/fstg01.qmd @@ -13,16 +13,14 @@ subtitle: Subgroup Analysis of Best Overall Response ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) library(nestcolor) -adsl_f <- synthetic_cdisc_dataset("latest", "adsl") %>% +adsl_f <- random.cdisc.data::cadsl %>% select(STUDYID, USUBJID, ARMCD, ARM, SEX, BMRKR2, STRATA1, STRATA2) -adrs_f <- synthetic_cdisc_dataset("latest", "adrs") %>% +adrs_f <- random.cdisc.data::cadrs %>% filter(PARAMCD == "INVET") %>% select(STUDYID, USUBJID, PARAMCD, AVISIT, AVALC) @@ -244,11 +242,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADRS <- synthetic_cdisc_dataset("latest", "adrs") + ADSL <- random.cdisc.data::cadsl + ADRS <- random.cdisc.data::cadrs }) datanames <- c("ADSL", "ADRS") datanames(data) <- datanames diff --git a/book/graphs/efficacy/fstg02.qmd b/book/graphs/efficacy/fstg02.qmd index f7042212f2..07d9c1923c 100644 --- a/book/graphs/efficacy/fstg02.qmd +++ b/book/graphs/efficacy/fstg02.qmd @@ -17,8 +17,6 @@ library(tern) library(dplyr) library(forcats) library(nestcolor) -library(scda) -library(scda.2022) preprocess_adtte <- function(adtte) { # Save variable labels before data processing steps. @@ -51,7 +49,7 @@ preprocess_adtte <- function(adtte) { adtte } -anl <- synthetic_cdisc_dataset("latest", "adtte") %>% +anl <- random.cdisc.data::cadtte %>% preprocess_adtte() ``` @@ -212,19 +210,17 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) library(forcats) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") + ADSL <- random.cdisc.data::cadsl ADSL <- ADSL %>% filter(ARM %in% c("B: Placebo", "A: Drug X")) %>% mutate(ARM = droplevels(fct_relevel(ARM, "B: Placebo"))) %>% mutate(ARMCD = droplevels(fct_relevel(ARMCD, "ARM B"))) ADSL$RACE <- droplevels(ADSL$RACE) - ADTTE <- synthetic_cdisc_dataset("latest", "adtte") + ADTTE <- random.cdisc.data::cadtte adtte_labels <- col_labels(ADTTE) ADTTE <- ADTTE %>% diff --git a/book/graphs/efficacy/kmg01.qmd b/book/graphs/efficacy/kmg01.qmd index b978e8ab1f..4316e498bb 100644 --- a/book/graphs/efficacy/kmg01.qmd +++ b/book/graphs/efficacy/kmg01.qmd @@ -14,12 +14,10 @@ subtitle: Kaplan-Meier Plot #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(nestcolor) -adtte <- synthetic_cdisc_dataset("latest", "adtte") +adtte <- random.cdisc.data::cadtte anl <- adtte %>% dplyr::filter(PARAMCD == "OS") %>% dplyr::mutate(is_event = CNSR == 0) @@ -183,11 +181,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADTTE <- synthetic_cdisc_dataset("latest", "adtte") + ADSL <- random.cdisc.data::cadsl + ADTTE <- random.cdisc.data::cadtte }) datanames <- c("ADSL", "ADTTE") datanames(data) <- datanames diff --git a/book/graphs/efficacy/mmrmg01.qmd b/book/graphs/efficacy/mmrmg01.qmd index 7a5884d1f0..fdca815b70 100644 --- a/book/graphs/efficacy/mmrmg01.qmd +++ b/book/graphs/efficacy/mmrmg01.qmd @@ -18,12 +18,10 @@ Given an MMRM fitted with `s_mmrm`, `g_mmrm_lsmeans` displays for each visit the library(dplyr) library(tern.mmrm) -library(scda) -library(scda.2022) library(nestcolor) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs adqs_f <- adqs %>% dplyr::filter(PARAMCD == "FKSI-FWB" & !AVISIT %in% c("BASELINE")) %>% @@ -124,12 +122,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADQS <- synthetic_cdisc_dataset("latest", "adqs") %>% + ADSL <- random.cdisc.data::cadsl + ADQS <- random.cdisc.data::cadqs %>% filter(ABLFL != "Y" & ABLFL2 != "Y") %>% filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 3 DAY 22")) %>% mutate( diff --git a/book/graphs/efficacy/mmrmg02.qmd b/book/graphs/efficacy/mmrmg02.qmd index d2d52917fb..ffee055d0d 100644 --- a/book/graphs/efficacy/mmrmg02.qmd +++ b/book/graphs/efficacy/mmrmg02.qmd @@ -13,14 +13,12 @@ subtitle: Forest Plot for Mixed-Effect Model Repeated Measures ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern.mmrm) library(nestcolor) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs adqs_f <- adqs %>% dplyr::filter(PARAMCD == "FKSI-FWB" & !AVISIT %in% c("BASELINE")) %>% diff --git a/book/graphs/other/brg01.qmd b/book/graphs/other/brg01.qmd index b403549599..d8745da8c4 100644 --- a/book/graphs/other/brg01.qmd +++ b/book/graphs/other/brg01.qmd @@ -16,13 +16,11 @@ subtitle: Bar Chart library(binom) library(dplyr) library(ggplot2) -library(scda) -library(scda.2022) library(tidyr) library(tern) library(nestcolor) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # filtered population patpop_df <- adsl %>% @@ -31,12 +29,12 @@ patpop_df <- adsl %>% patpop <- setNames(patpop_df$patpop, patpop_df$STUDYID) denom <- patpop_df$patpop -adae <- synthetic_cdisc_dataset("latest", "adae") %>% +adae <- random.cdisc.data::cadae %>% mutate(AETOXGRC = as.character(AETOXGR)) attributes(adae$AETOXGRC)$label <- "Analysis Toxicity Grade (C)" vl_ae <- var_labels(adae) -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adlb <- random.cdisc.data::cadlb vl_lb <- var_labels(adlb) ``` @@ -153,7 +151,6 @@ plot ## {{< fa regular file-lines sm fw >}} Preview - ```{r plot5, test = list(plot_v5 = "plot"), opts.label = "skip_test_strict"} anl <- adlb %>% filter(PARAMCD == "ALT" & ANRIND == "HIGH") diff --git a/book/graphs/other/bwg01.qmd b/book/graphs/other/bwg01.qmd index 610b2bbac4..063e885cc9 100644 --- a/book/graphs/other/bwg01.qmd +++ b/book/graphs/other/bwg01.qmd @@ -14,13 +14,11 @@ subtitle: Box Plot #| code-fold: show # generic code for all plots -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adlb <- random.cdisc.data::cadlb adlb <- adlb %>% filter(PARAMCD == "ALT" & AVISIT == "WEEK 2 DAY 15") # Definition of boxplot boundaries and whiskers @@ -244,8 +242,8 @@ plot ```{r plot6, test = list(plot_v6 = "plot"), opts.label = "skip_test_strict"} -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adlb_v <- adlb %>% filter(PARAMCD == "ALT" & AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 3 DAY 22", "WEEK 4 DAY 29")) @@ -433,12 +431,10 @@ library(teal.modules.general) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(tern) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb # If PARAMCD and AVISIT are not factors, convert to factors # Also fill in missing values with "" diff --git a/book/graphs/other/cig01.qmd b/book/graphs/other/cig01.qmd index 0f1f34df26..a99349a476 100644 --- a/book/graphs/other/cig01.qmd +++ b/book/graphs/other/cig01.qmd @@ -16,11 +16,9 @@ subtitle: Confidence Interval Plot library(tern) library(ggplot2) library(dplyr) -library(scda) -library(scda.2022) library(nestcolor) -adlb <- synthetic_cdisc_dataset("latest", "adlb") %>% +adlb <- random.cdisc.data::cadlb %>% filter(PARAMCD == "ALT", AVISIT == "BASELINE") ``` @@ -214,11 +212,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb }) datanames <- c("ADSL", "ADLB") datanames(data) <- datanames diff --git a/book/graphs/other/ippg01.qmd b/book/graphs/other/ippg01.qmd index 8881478c4d..cb2d311ccb 100644 --- a/book/graphs/other/ippg01.qmd +++ b/book/graphs/other/ippg01.qmd @@ -16,15 +16,13 @@ For illustration purposes, we will subset the `adlb` dataset for safety populati #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) # use small sample size -adsl <- synthetic_cdisc_dataset("latest", "adsl") %>% slice(1:15) -adlb <- synthetic_cdisc_dataset("latest", "adlb") %>% filter(USUBJID %in% adsl$USUBJID) +adsl <- random.cdisc.data::cadsl %>% slice(1:15) +adlb <- random.cdisc.data::cadlb %>% filter(USUBJID %in% adsl$USUBJID) # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adlb <- df_explicit_na(adlb) @@ -113,13 +111,11 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) # use small sample size - ADSL <- synthetic_cdisc_dataset("latest", "adsl") %>% slice(1:15) - ADLB <- synthetic_cdisc_dataset("latest", "adlb") %>% filter(USUBJID %in% ADSL$USUBJID) + ADSL <- random.cdisc.data::cadsl %>% slice(1:15) + ADLB <- random.cdisc.data::cadlb %>% filter(USUBJID %in% ADSL$USUBJID) # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/graphs/other/ltg01.qmd b/book/graphs/other/ltg01.qmd index 81e191870a..f3380a54dd 100644 --- a/book/graphs/other/ltg01.qmd +++ b/book/graphs/other/ltg01.qmd @@ -15,8 +15,6 @@ Lattice plots are natively handled by R, the examples below rely mostly on the p ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(teal.modules.clinical) library(ggplot2) @@ -24,8 +22,8 @@ library(dplyr) library(nestcolor) # Datasets -adsl <- synthetic_cdisc_dataset("latest", "adsl") %>% slice(1:8) -adlb <- synthetic_cdisc_dataset("latest", "adlb") %>% filter(USUBJID %in% adsl$USUBJID) +adsl <- random.cdisc.data::cadsl %>% slice(1:8) +adlb <- random.cdisc.data::cadlb %>% filter(USUBJID %in% adsl$USUBJID) # Pre-processing adlb$AVISIT_txt <- adlb$AVISIT @@ -135,8 +133,8 @@ The example below suggests a larger dataset, where the individual subject legend #| code-fold: show # Datasets -adsl <- synthetic_cdisc_dataset("latest", "adsl") %>% slice(1:40) -adlb <- synthetic_cdisc_dataset("latest", "adlb") %>% filter(USUBJID %in% adsl$USUBJID) +adsl <- random.cdisc.data::cadsl %>% slice(1:40) +adlb <- random.cdisc.data::cadlb %>% filter(USUBJID %in% adsl$USUBJID) # Pre-processing adlb$AVISIT_txt <- adlb$AVISIT diff --git a/book/graphs/other/mng01.qmd b/book/graphs/other/mng01.qmd index 23b2bef627..34bdd06998 100644 --- a/book/graphs/other/mng01.qmd +++ b/book/graphs/other/mng01.qmd @@ -15,13 +15,11 @@ subtitle: Mean Plot library(dplyr) library(tern) -library(scda) -library(scda.2022) library(nestcolor) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") -advs <- synthetic_cdisc_dataset("latest", "advs") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb +advs <- random.cdisc.data::cadvs adsl_f <- adsl %>% filter(SAFFL == "Y") %>% @@ -211,13 +209,11 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) library(forcats) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") %>% + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb %>% mutate(AVISIT = fct_reorder(AVISIT, AVISITN, min)) }) datanames <- c("ADSL", "ADLB") diff --git a/book/graphs/pharmacokinetic/pkcg01.qmd b/book/graphs/pharmacokinetic/pkcg01.qmd index 15b1842d62..ae95cbf64d 100644 --- a/book/graphs/pharmacokinetic/pkcg01.qmd +++ b/book/graphs/pharmacokinetic/pkcg01.qmd @@ -14,13 +14,11 @@ subtitle: Plot of PK Concentration Over Time by Subject #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) -adpc <- synthetic_cdisc_dataset("latest", "adpc") +adpc <- random.cdisc.data::cadpc ``` ## Plot in Linear Scale diff --git a/book/graphs/pharmacokinetic/pkcg02.qmd b/book/graphs/pharmacokinetic/pkcg02.qmd index e9ffa4b2f9..0389fa6a4e 100644 --- a/book/graphs/pharmacokinetic/pkcg02.qmd +++ b/book/graphs/pharmacokinetic/pkcg02.qmd @@ -14,13 +14,11 @@ subtitle: Plot of PK Concentration Over Time by Cohort/Treatment Group/Dose #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) -adpc <- synthetic_cdisc_dataset("latest", "adpc") +adpc <- random.cdisc.data::cadpc ``` ## Plot in Linear Scale diff --git a/book/graphs/pharmacokinetic/pkcg03.qmd b/book/graphs/pharmacokinetic/pkcg03.qmd index 8768a79beb..357ae99df9 100644 --- a/book/graphs/pharmacokinetic/pkcg03.qmd +++ b/book/graphs/pharmacokinetic/pkcg03.qmd @@ -14,17 +14,15 @@ subtitle: Plot of Mean PK Concentration Over Time by Cohort #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) -adsl_f <- synthetic_cdisc_dataset("latest", "adsl") %>% +adsl_f <- random.cdisc.data::cadsl %>% filter(SAFFL == "Y" & ARM != "B: Placebo") %>% df_explicit_na() -adpc <- synthetic_cdisc_dataset("latest", "adpc") %>% +adpc <- random.cdisc.data::cadpc %>% mutate(Patient_ID = sub(".*id-", "", USUBJID)) %>% filter(PARAM == "Plasma Drug X") %>% droplevels() %>% diff --git a/book/graphs/pharmacokinetic/pkpg01.qmd b/book/graphs/pharmacokinetic/pkpg01.qmd index 3a2447ea4b..aabc87e721 100644 --- a/book/graphs/pharmacokinetic/pkpg01.qmd +++ b/book/graphs/pharmacokinetic/pkpg01.qmd @@ -14,15 +14,13 @@ subtitle: Plot of Mean Cumulative Percentage (%) of Recovered Drug in Urine #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) set.seed(123) # loading in the data -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp # filtering the rows for specific data entries adpp <- adpp %>% diff --git a/book/graphs/pharmacokinetic/pkpg02.qmd b/book/graphs/pharmacokinetic/pkpg02.qmd index 87c348bcf9..1436a372e2 100644 --- a/book/graphs/pharmacokinetic/pkpg02.qmd +++ b/book/graphs/pharmacokinetic/pkpg02.qmd @@ -14,15 +14,13 @@ subtitle: Pharmacokinetic Parameter Summary of Serum PK Parameters by Treatment #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) # need adex for dose info and adpp for AUC max info -adex <- synthetic_cdisc_dataset("latest", "adex") -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adex <- random.cdisc.data::cadex +adpp <- random.cdisc.data::cadpp adpp_a <- adpp %>% filter( diff --git a/book/graphs/pharmacokinetic/pkpg03.qmd b/book/graphs/pharmacokinetic/pkpg03.qmd index ecf90046fd..1522c87bed 100644 --- a/book/graphs/pharmacokinetic/pkpg03.qmd +++ b/book/graphs/pharmacokinetic/pkpg03.qmd @@ -14,13 +14,11 @@ subtitle: Box Plot of Pharmacokinetic Parameters by Visit -- Plasma #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(nestcolor) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp ``` ## Plot of CMAX by Visit diff --git a/book/graphs/pharmacokinetic/pkpg04.qmd b/book/graphs/pharmacokinetic/pkpg04.qmd index 8477ee9d0f..357a6f0ee1 100644 --- a/book/graphs/pharmacokinetic/pkpg04.qmd +++ b/book/graphs/pharmacokinetic/pkpg04.qmd @@ -14,14 +14,12 @@ subtitle: Box Plot of Pharmacokinetic Parameters by Visit -- Plasma #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(ggplot2) library(ggrepel) library(nestcolor) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp ``` ## Plot of CMAX by Visit diff --git a/book/graphs/pharmacokinetic/pkpg06.qmd b/book/graphs/pharmacokinetic/pkpg06.qmd index b747bd3f7d..d4ff113d1c 100644 --- a/book/graphs/pharmacokinetic/pkpg06.qmd +++ b/book/graphs/pharmacokinetic/pkpg06.qmd @@ -14,14 +14,12 @@ subtitle: Boxplot of Metabolite to Parent Ratios by Treatment #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(ggplot2) library(tidyr) library(tern) library(nestcolor) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp # Filter NAs adpp <- adpp %>% diff --git a/book/listings/ADA/adal02.qmd b/book/listings/ADA/adal02.qmd index 8c3c740e08..33e9b1cc9f 100644 --- a/book/listings/ADA/adal02.qmd +++ b/book/listings/ADA/adal02.qmd @@ -15,10 +15,8 @@ subtitle: Listing of Anti-Drug Antibody Data for Treatment Emergent ADA Positive library(dplyr) library(rlistings) -library(scda) -library(scda.2022) -adab <- synthetic_cdisc_dataset("latest", "adab") %>% +adab <- random.cdisc.data::cadab %>% filter(NFRLT %% 1 == 0 & NFRLT > 0) trt <- "A: Drug X" diff --git a/book/listings/ECG/egl01.qmd b/book/listings/ECG/egl01.qmd index 13dddd91a7..ab67169bb0 100644 --- a/book/listings/ECG/egl01.qmd +++ b/book/listings/ECG/egl01.qmd @@ -14,11 +14,9 @@ subtitle: 'Listing of ECG Data: Safety-Evaluable Patients' #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adeg <- synthetic_cdisc_dataset("latest", "adeg") +adeg <- random.cdisc.data::cadeg get_param_unit_range <- function(dataset) { u_rng <- lapply(unique(dataset$PARAMCD), function(p) { diff --git a/book/listings/adverse-events/ael01.qmd b/book/listings/adverse-events/ael01.qmd index 3b407ed324..5112035378 100644 --- a/book/listings/adverse-events/ael01.qmd +++ b/book/listings/adverse-events/ael01.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Preferred Terms, Lowest Level Terms, and Investigator-Speci ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae out <- adae %>% select(AESOC, AEDECOD, AELLT, AETERM) %>% diff --git a/book/listings/adverse-events/ael01_nollt.qmd b/book/listings/adverse-events/ael01_nollt.qmd index 2d69881016..0153bc8b90 100644 --- a/book/listings/adverse-events/ael01_nollt.qmd +++ b/book/listings/adverse-events/ael01_nollt.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Preferred Terms and Investigator-Specified Adverse Event Te ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae out <- adae %>% select(AESOC, AEDECOD, AETERM) %>% diff --git a/book/listings/adverse-events/ael02.qmd b/book/listings/adverse-events/ael02.qmd index 166cb605cd..0f466aa1db 100644 --- a/book/listings/adverse-events/ael02.qmd +++ b/book/listings/adverse-events/ael02.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Adverse Events #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae out <- adae %>% mutate( diff --git a/book/listings/adverse-events/ael02_ed.qmd b/book/listings/adverse-events/ael02_ed.qmd index 623606a41e..8637b1cad0 100644 --- a/book/listings/adverse-events/ael02_ed.qmd +++ b/book/listings/adverse-events/ael02_ed.qmd @@ -14,12 +14,10 @@ subtitle: Listing of Adverse Events (for Early Development Studies) #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) library(lubridate) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae adae_anl <- adae %>% filter(SAFFL == "Y") %>% diff --git a/book/listings/adverse-events/ael03.qmd b/book/listings/adverse-events/ael03.qmd index 6917f7655a..f1a690a3f4 100644 --- a/book/listings/adverse-events/ael03.qmd +++ b/book/listings/adverse-events/ael03.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Serious Adverse Events ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae out <- adae %>% filter(AESER == "Y") %>% diff --git a/book/listings/adverse-events/ael04.qmd b/book/listings/adverse-events/ael04.qmd index 23c887c7d6..e1f1a2f1d2 100644 --- a/book/listings/adverse-events/ael04.qmd +++ b/book/listings/adverse-events/ael04.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Patient Deaths #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl out <- adsl %>% filter(!is.na(DTHADY)) %>% diff --git a/book/listings/concomitant-medications/cml01.qmd b/book/listings/concomitant-medications/cml01.qmd index 65e7ed40eb..75b14e5d47 100644 --- a/book/listings/concomitant-medications/cml01.qmd +++ b/book/listings/concomitant-medications/cml01.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Previous and Concomitant Medications #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adcm <- random.cdisc.data::cadcm out <- adcm %>% filter(!is.na(CMDECOD)) %>% diff --git a/book/listings/concomitant-medications/cml02a_gl.qmd b/book/listings/concomitant-medications/cml02a_gl.qmd index 9df1ec3533..14d6aa3883 100644 --- a/book/listings/concomitant-medications/cml02a_gl.qmd +++ b/book/listings/concomitant-medications/cml02a_gl.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Concomitant Medication Class Level 2, Preferred Name, and I ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adcm <- random.cdisc.data::cadcm out <- adcm %>% select(ATC2, CMDECOD, CMTRT) %>% diff --git a/book/listings/concomitant-medications/cml02b_gl.qmd b/book/listings/concomitant-medications/cml02b_gl.qmd index d047d9b72a..3c283a6e9d 100644 --- a/book/listings/concomitant-medications/cml02b_gl.qmd +++ b/book/listings/concomitant-medications/cml02b_gl.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Concomitant Medication Class, Preferred Name, and Investiga ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adcm <- random.cdisc.data::cadcm out <- adcm %>% select(ATC1, ATC2, ATC3, ATC4, CMDECOD, CMTRT) %>% diff --git a/book/listings/development-safety-update-report/dsur4.qmd b/book/listings/development-safety-update-report/dsur4.qmd index d5ad418f94..76b377f449 100644 --- a/book/listings/development-safety-update-report/dsur4.qmd +++ b/book/listings/development-safety-update-report/dsur4.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Patients Who Died During Reporting Period ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl out <- adsl %>% filter(DTHFL == "Y") %>% diff --git a/book/listings/disposition/dsl01.qmd b/book/listings/disposition/dsl01.qmd index 5fe113e61d..632f2ba14a 100644 --- a/book/listings/disposition/dsl01.qmd +++ b/book/listings/disposition/dsl01.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Patients with Study Drug Withdrawn Due to Adverse Events ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl out <- adsl %>% filter(AEWITHFL == "Y") %>% diff --git a/book/listings/disposition/dsl02.qmd b/book/listings/disposition/dsl02.qmd index 67a11e97d5..5e1b256aba 100644 --- a/book/listings/disposition/dsl02.qmd +++ b/book/listings/disposition/dsl02.qmd @@ -13,12 +13,10 @@ subtitle: Listing of Patients Who Discontinued Early from Study ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl out <- adsl %>% filter(AEWITHFL == "Y") %>% diff --git a/book/listings/efficacy/oncl01.qmd b/book/listings/efficacy/oncl01.qmd index 032bebaa89..73fe222078 100644 --- a/book/listings/efficacy/oncl01.qmd +++ b/book/listings/efficacy/oncl01.qmd @@ -13,14 +13,12 @@ subtitle: Listing of Individual Efficacy Data ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(rlistings) -adrs <- synthetic_cdisc_dataset("latest", "adrs") -adtte <- synthetic_cdisc_dataset("latest", "adtte") -adex <- synthetic_cdisc_dataset("latest", "adex") +adrs <- random.cdisc.data::cadrs +adtte <- random.cdisc.data::cadtte +adex <- random.cdisc.data::cadex out_ex <- adex %>% filter(PARAMCD == "TNDOSE") %>% diff --git a/book/listings/exposure/exl01.qmd b/book/listings/exposure/exl01.qmd index 76d9850d5e..b6f1d958af 100644 --- a/book/listings/exposure/exl01.qmd +++ b/book/listings/exposure/exl01.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Exposure to Study Drug #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adex <- synthetic_cdisc_dataset("latest", "adex") +adex <- random.cdisc.data::cadex out <- adex %>% filter(PARAMCD == "DOSE" & !is.na(AVAL) & SAFFL == "Y") %>% diff --git a/book/listings/lab-results/lbl01.qmd b/book/listings/lab-results/lbl01.qmd index 8edc48dffd..d08c567033 100644 --- a/book/listings/lab-results/lbl01.qmd +++ b/book/listings/lab-results/lbl01.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Laboratory Test Results #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adlb <- random.cdisc.data::cadlb adlb_x <- adlb %>% filter(!is.na(AVAL) & !is.na(LBSEQ) & !is.na(ADY) & ANRIND != "") %>% diff --git a/book/listings/lab-results/lbl01_rls.qmd b/book/listings/lab-results/lbl01_rls.qmd index b1601eb34a..a3fcf1a17e 100644 --- a/book/listings/lab-results/lbl01_rls.qmd +++ b/book/listings/lab-results/lbl01_rls.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Laboratory Test Results Using Roche Safety Lab Standardizat #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adlb <- synthetic_cdisc_dataset("latest", "adlb") %>% +adlb <- random.cdisc.data::cadlb %>% filter(!is.na(AVAL)) adlb_x <- adlb %>% diff --git a/book/listings/lab-results/lbl02a.qmd b/book/listings/lab-results/lbl02a.qmd index d4ffd25287..04b9a40a6d 100644 --- a/book/listings/lab-results/lbl02a.qmd +++ b/book/listings/lab-results/lbl02a.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Laboratory Abnormalities (constant units) #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adlb <- random.cdisc.data::cadlb adlb_x <- adlb %>% filter( diff --git a/book/listings/lab-results/lbl02a_rls.qmd b/book/listings/lab-results/lbl02a_rls.qmd index 61e1aa523f..0536e3a430 100644 --- a/book/listings/lab-results/lbl02a_rls.qmd +++ b/book/listings/lab-results/lbl02a_rls.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Laboratory Abnormalities Defined by Roche Safety Lab Standa #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adlb <- random.cdisc.data::cadlb adlb_x <- adlb %>% filter( diff --git a/book/listings/lab-results/lbl02b.qmd b/book/listings/lab-results/lbl02b.qmd index 141c5d935b..726da32aab 100644 --- a/book/listings/lab-results/lbl02b.qmd +++ b/book/listings/lab-results/lbl02b.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Laboratory Abnormalities (variable units) #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adlb <- random.cdisc.data::cadlb adlb_x <- adlb %>% filter( diff --git a/book/listings/medical-history/mhl01.qmd b/book/listings/medical-history/mhl01.qmd index b57f603b52..132856e8d2 100644 --- a/book/listings/medical-history/mhl01.qmd +++ b/book/listings/medical-history/mhl01.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Medical History and Concurrent Diseases #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -admh <- synthetic_cdisc_dataset("latest", "admh") +admh <- random.cdisc.data::cadmh out <- admh %>% mutate( diff --git a/book/listings/pharmacokinetic/pkcl01.qmd b/book/listings/pharmacokinetic/pkcl01.qmd index e24972fc40..8eaa8ea9ff 100644 --- a/book/listings/pharmacokinetic/pkcl01.qmd +++ b/book/listings/pharmacokinetic/pkcl01.qmd @@ -14,11 +14,9 @@ subtitle: Listing of Drug A Concentration by Treatment Group, Patient and Nomina #| code-fold: show library(rlistings) -library(scda) -library(scda.2022) library(dplyr) -adpc <- synthetic_cdisc_dataset("latest", "adpc") +adpc <- random.cdisc.data::cadpc analyte <- "Plasma Drug X" diff --git a/book/listings/pharmacokinetic/pkcl02.qmd b/book/listings/pharmacokinetic/pkcl02.qmd index 238164a630..f041982f88 100644 --- a/book/listings/pharmacokinetic/pkcl02.qmd +++ b/book/listings/pharmacokinetic/pkcl02.qmd @@ -15,13 +15,11 @@ subtitle: Listing of Drug A Urine Concentration and Volumes library(dplyr) library(rlistings) -library(scda) -library(scda.2022) drug_a <- "Drug X" spec <- "URINE" -adpc <- synthetic_cdisc_dataset("latest", "adpc") +adpc <- random.cdisc.data::cadpc adpc_x <- adpc %>% mutate(REGIMEN = ifelse("REGIMEN" %in% names(adpc), REGIMEN, "BID")) %>% filter( diff --git a/book/listings/pharmacokinetic/pkpl01.qmd b/book/listings/pharmacokinetic/pkpl01.qmd index 7bfa1418f6..7de39e998a 100644 --- a/book/listings/pharmacokinetic/pkpl01.qmd +++ b/book/listings/pharmacokinetic/pkpl01.qmd @@ -15,13 +15,11 @@ subtitle: Listing of Drug A Plasma PK Parameters library(dplyr) library(rlistings) -library(scda) -library(scda.2022) drug_a <- "Plasma Drug X" spec <- "Plasma" -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp_x <- adpp %>% filter( PPCAT == drug_a, PPSPEC == spec diff --git a/book/listings/pharmacokinetic/pkpl02.qmd b/book/listings/pharmacokinetic/pkpl02.qmd index 48e9ec5393..f2defbcb36 100644 --- a/book/listings/pharmacokinetic/pkpl02.qmd +++ b/book/listings/pharmacokinetic/pkpl02.qmd @@ -15,13 +15,11 @@ subtitle: Listing of Drug A Urine PK Parameters library(dplyr) library(rlistings) -library(scda) -library(scda.2022) drug_a <- "Plasma Drug X" spec <- "Urine" -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp_x <- adpp %>% filter( PPCAT == drug_a, PPSPEC == spec diff --git a/book/listings/pharmacokinetic/pkpl04.qmd b/book/listings/pharmacokinetic/pkpl04.qmd index 8c0ec70255..85a8c96a97 100644 --- a/book/listings/pharmacokinetic/pkpl04.qmd +++ b/book/listings/pharmacokinetic/pkpl04.qmd @@ -15,10 +15,8 @@ subtitle: Listing of Individual Drug A AUCIFO and CMAX Ratios Following Drug A o library(dplyr) library(rlistings) -library(scda) -library(scda.2022) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp visit <- "CYCLE 1 DAY 1" drug_a <- "Plasma Drug X" # numerator drug diff --git a/book/listings/vital-signs/vsl01.qmd b/book/listings/vital-signs/vsl01.qmd index a8bce52275..3110463cc6 100644 --- a/book/listings/vital-signs/vsl01.qmd +++ b/book/listings/vital-signs/vsl01.qmd @@ -14,11 +14,9 @@ subtitle: 'Listing of Vital Signs: Safety-Evaluable Patients' #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(rlistings) -advs <- synthetic_cdisc_dataset("latest", "advs") +advs <- random.cdisc.data::cadvs get_param_unit_range <- function(dataset) { u_rng <- lapply(unique(dataset$PARAMCD), function(p) { diff --git a/book/tables/ADA/adat01.qmd b/book/tables/ADA/adat01.qmd index cd9f87b356..87e31a723f 100644 --- a/book/tables/ADA/adat01.qmd +++ b/book/tables/ADA/adat01.qmd @@ -15,12 +15,10 @@ subtitle: Baseline Prevalence and Incidence of Treatment Emergent ADA library(tern) library(dplyr) -library(scda) -library(scda.2022) library(tibble) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adab <- synthetic_cdisc_dataset("latest", "adab") +adsl <- random.cdisc.data::cadsl +adab <- random.cdisc.data::cadab combodf <- tribble( ~valname, ~label, ~levelcombo, ~exargs, diff --git a/book/tables/ADA/adat02.qmd b/book/tables/ADA/adat02.qmd index 4daf4c1892..1e96d6549c 100644 --- a/book/tables/ADA/adat02.qmd +++ b/book/tables/ADA/adat02.qmd @@ -15,11 +15,9 @@ subtitle: Summary of Patients with Treatment-Induced ADA library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adab <- synthetic_cdisc_dataset("latest", "adab") +adsl <- random.cdisc.data::cadsl +adab <- random.cdisc.data::cadab # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/ADA/adat03.qmd b/book/tables/ADA/adat03.qmd index 8a5b762ae8..dbfeba7646 100644 --- a/book/tables/ADA/adat03.qmd +++ b/book/tables/ADA/adat03.qmd @@ -14,13 +14,11 @@ subtitle: Summary of Serum Concentrations at Timepoints Where ADA Samples Were C #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adab <- synthetic_cdisc_dataset("latest", "adab") -adpc <- synthetic_cdisc_dataset("latest", "adpc") +adsl <- random.cdisc.data::cadsl +adab <- random.cdisc.data::cadab +adpc <- random.cdisc.data::cadpc # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/ADA/adat04a.qmd b/book/tables/ADA/adat04a.qmd index ee8edc7188..66e5168837 100644 --- a/book/tables/ADA/adat04a.qmd +++ b/book/tables/ADA/adat04a.qmd @@ -15,12 +15,10 @@ subtitle: Baseline Prevalence and Incidence of Treatment Emergent NAbs library(tern) library(dplyr) -library(scda) -library(scda.2022) library(tibble) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adab <- synthetic_cdisc_dataset("latest", "adab") +adsl <- random.cdisc.data::cadsl +adab <- random.cdisc.data::cadab combodf <- tribble( ~valname, ~label, ~levelcombo, ~exargs, diff --git a/book/tables/ADA/adat04b.qmd b/book/tables/ADA/adat04b.qmd index 5fc4dc1f42..7ac19e32ec 100644 --- a/book/tables/ADA/adat04b.qmd +++ b/book/tables/ADA/adat04b.qmd @@ -15,12 +15,10 @@ subtitle: Baseline Prevalence and Incidence of NAbs library(tern) library(dplyr) -library(scda) -library(scda.2022) library(tibble) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adab <- synthetic_cdisc_dataset("latest", "adab") +adsl <- random.cdisc.data::cadsl +adab <- random.cdisc.data::cadab combodf <- tribble( ~valname, ~label, ~levelcombo, ~exargs, diff --git a/book/tables/ECG/egt01.qmd b/book/tables/ECG/egt01.qmd index 66202265cd..c49e4d3631 100644 --- a/book/tables/ECG/egt01.qmd +++ b/book/tables/ECG/egt01.qmd @@ -15,16 +15,14 @@ subtitle: ECG Results and Change from Baseline by Visit library(dplyr) library(tern) -library(scda) -library(scda.2022) # Data should be filtered for the studied Parameter (`PARAM`) and the # Analysis Visit (`AVISIT`). According to the GDSR template, the values for # the `AVISIT` reported in the EGT01 standard may be: # 'POST-BASELINE MAXIMUM', 'POST-BASELINE MINIMUM', 'POST-BASELINE LAST'. -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adeg <- synthetic_cdisc_dataset("latest", "adeg") +adsl <- random.cdisc.data::cadsl +adeg <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -95,17 +93,15 @@ result ## {{< fa regular file-lines fa-sm fa-fw >}} Preview + ```{r teal, opts.label = c("skip_if_testing", "app"), eval = packageVersion("teal.modules.clinical") >= "0.9.0.9007"} library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEG <- synthetic_cdisc_dataset("latest", "adeg") + ADSL <- random.cdisc.data::cadsl + ADEG <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/ECG/egt02.qmd b/book/tables/ECG/egt02.qmd index 92e2e3a204..6495542bd6 100644 --- a/book/tables/ECG/egt02.qmd +++ b/book/tables/ECG/egt02.qmd @@ -14,12 +14,10 @@ subtitle: ECG Abnormalities (EGT02_1 & EGT02_2) #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adeg <- synthetic_cdisc_dataset("latest", "adeg") +adsl <- random.cdisc.data::cadsl +adeg <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -103,11 +101,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEG <- synthetic_cdisc_dataset("latest", "adeg") + ADSL <- random.cdisc.data::cadsl + ADEG <- random.cdisc.data::cadeg }) datanames <- c("ADSL", "ADEG") datanames(data) <- datanames diff --git a/book/tables/ECG/egt03.qmd b/book/tables/ECG/egt03.qmd index 0e5475fe53..a19975836f 100644 --- a/book/tables/ECG/egt03.qmd +++ b/book/tables/ECG/egt03.qmd @@ -13,12 +13,10 @@ subtitle: Shift Table of ECG Interval Data -- Baseline Versus Minimum/Maximum Po ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adeg <- synthetic_cdisc_dataset("latest", "adeg") +adeg <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adeg <- df_explicit_na(adeg) @@ -166,11 +164,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEG <- synthetic_cdisc_dataset("latest", "adeg") + ADSL <- random.cdisc.data::cadsl + ADEG <- random.cdisc.data::cadeg }) datanames <- c("ADSL", "ADEG") datanames(data) <- datanames diff --git a/book/tables/ECG/egt04.qmd b/book/tables/ECG/egt04.qmd index 5b7d4a98bb..8ea98251c4 100644 --- a/book/tables/ECG/egt04.qmd +++ b/book/tables/ECG/egt04.qmd @@ -16,14 +16,12 @@ For illustration purposes, missing data are added to the example dataset. ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) set.seed(123) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adeg <- synthetic_cdisc_dataset("latest", "adeg") +adsl <- random.cdisc.data::cadsl +adeg <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/ECG/egt05_qtcat.qmd b/book/tables/ECG/egt05_qtcat.qmd index 9e7b066933..89eed5f375 100644 --- a/book/tables/ECG/egt05_qtcat.qmd +++ b/book/tables/ECG/egt05_qtcat.qmd @@ -14,12 +14,10 @@ subtitle: ECG Actual Values and Changes from Baseline by Visit #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adeg <- synthetic_cdisc_dataset("latest", "adeg") +adsl <- random.cdisc.data::cadsl +adeg <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -124,12 +122,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEG <- synthetic_cdisc_dataset("latest", "adeg") + ADSL <- random.cdisc.data::cadsl + ADEG <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet01.qmd b/book/tables/adverse-events/aet01.qmd index 9fdc2a8ee8..a34f8ed074 100644 --- a/book/tables/adverse-events/aet01.qmd +++ b/book/tables/adverse-events/aet01.qmd @@ -17,11 +17,9 @@ To illustrate, additional variables such as flags (TRUE/FALSE) for select AEs of library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -383,12 +381,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae add_event_flags <- function(dat) { dat %>% diff --git a/book/tables/adverse-events/aet01_aesi.qmd b/book/tables/adverse-events/aet01_aesi.qmd index 66f13cfbd8..5690c6556f 100644 --- a/book/tables/adverse-events/aet01_aesi.qmd +++ b/book/tables/adverse-events/aet01_aesi.qmd @@ -8,7 +8,6 @@ subtitle: Safety Summary (Adverse Events of Special Interest) {{< include ../../_utils/envir_hook.qmd >}} :::: {.panel-tabset} - ## Data Setup To illustrate, additional variables such as flags (TRUE/FALSE) for selected AEs of interest. @@ -19,11 +18,9 @@ Please consult your SAP on how to handle missing AE grades. library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae adsl <- filter(adsl, SAFFL == "Y") adae <- filter(adae, ANL01FL == "Y" & SAFFL == "Y") @@ -255,8 +252,8 @@ result ## {{< fa regular file-lines fa-sm fa-fw >}} Preview ```{r variant3, test = list(result_v3 = "result")} -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae_mult <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae_mult <- random.cdisc.data::cadae adsl <- filter(adsl, SAFFL == "Y") adae_mult <- filter(adae_mult, ANL01FL == "Y" & SAFFL == "Y") @@ -533,6 +530,7 @@ result ``` + `r webr_code_labels <- c("variant3")` {{< include ../../_utils/webr.qmd >}} ::: @@ -543,8 +541,8 @@ result ## {{< fa regular file-lines fa-sm fa-fw >}} Preview ```{r variant4, test = list(result_v4 = "result")} -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae adsl <- filter(adsl, SAFFL == "Y") adae <- filter(adae, ANL01FL == "Y" & SAFFL == "Y") @@ -731,12 +729,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae ADAE <- filter(ADAE, ANL01FL == "Y" & SAFFL == "Y") not_resolved <- ADAE %>% diff --git a/book/tables/adverse-events/aet02.qmd b/book/tables/adverse-events/aet02.qmd index 4afdde78f7..f82d99b111 100644 --- a/book/tables/adverse-events/aet02.qmd +++ b/book/tables/adverse-events/aet02.qmd @@ -7,7 +7,7 @@ subtitle: Adverse Events {{< include ../../_utils/envir_hook.qmd >}} -::::: {.panel-tabset} +:::: {.panel-tabset} ## Data Setup ```{r setup, message = FALSE} @@ -15,11 +15,9 @@ subtitle: Adverse Events library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -742,11 +740,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet02_smq.qmd b/book/tables/adverse-events/aet02_smq.qmd index be1423b7a0..f7a9b1db38 100644 --- a/book/tables/adverse-events/aet02_smq.qmd +++ b/book/tables/adverse-events/aet02_smq.qmd @@ -15,12 +15,10 @@ subtitle: Adverse Events by Standardized MedDRA Query library(dplyr) library(tern) -library(scda) -library(scda.2022) library(stringr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -201,11 +199,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae }) datanames <- c("ADSL", "ADAE") datanames(data) <- datanames diff --git a/book/tables/adverse-events/aet03.qmd b/book/tables/adverse-events/aet03.qmd index 4f9e670c26..9f1249a57e 100644 --- a/book/tables/adverse-events/aet03.qmd +++ b/book/tables/adverse-events/aet03.qmd @@ -14,11 +14,9 @@ subtitle: Adverse Events by Greatest Intensity #| code-fold: show library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -107,6 +105,7 @@ result ``` + `r webr_code_labels <- c("setup", "pre-processing", "variant1")` {{< include ../../_utils/webr.qmd >}} ::: @@ -124,11 +123,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae }) datanames <- c("ADSL", "ADAE") datanames(data) <- datanames diff --git a/book/tables/adverse-events/aet04.qmd b/book/tables/adverse-events/aet04.qmd index 54e9356b49..8db38216b6 100644 --- a/book/tables/adverse-events/aet04.qmd +++ b/book/tables/adverse-events/aet04.qmd @@ -15,11 +15,9 @@ subtitle: Adverse Events by Highest NCI CTCAE Grade library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) %>% filter(TRT01A != "") @@ -584,8 +582,7 @@ result ## Table with an Incidence Rate
$\geq$ 5%, SOCs \< 5% Removed -Variant 10 was not done -With this variant, SOC levels above the threshold are still in the table even if there are no terms left. +Variant 10 was not done With this variant, SOC levels above the threshold are still in the table even if there are no terms left. ## Table with an Incidence Rate $\geq$ 40%,
All SOCs w/o Preferred Terms Removed @@ -618,11 +615,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae }) datanames <- c("ADSL", "ADAE") datanames(data) <- datanames diff --git a/book/tables/adverse-events/aet04_pi.qmd b/book/tables/adverse-events/aet04_pi.qmd index ee3863e21a..20a7fddb27 100644 --- a/book/tables/adverse-events/aet04_pi.qmd +++ b/book/tables/adverse-events/aet04_pi.qmd @@ -13,8 +13,6 @@ subtitle: Adverse Events Reported in $\geq$ 10% of Patients by Highest NCI CTCAE ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) @@ -68,8 +66,8 @@ criteria_fun <- function(tr) { is(tr, "ContentRow") } -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae_max <- synthetic_cdisc_dataset("latest", "adae") %>% +adsl <- random.cdisc.data::cadsl +adae_max <- random.cdisc.data::cadae %>% preprocess_adae() %>% df_explicit_na() ``` @@ -438,11 +436,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae }) datanames <- c("ADSL", "ADAE") datanames(data) <- datanames diff --git a/book/tables/adverse-events/aet05.qmd b/book/tables/adverse-events/aet05.qmd index fd1aa547e0..75d193417b 100644 --- a/book/tables/adverse-events/aet05.qmd +++ b/book/tables/adverse-events/aet05.qmd @@ -14,12 +14,10 @@ subtitle: Adverse Event Rate Adjusted for Patient-Years at Risk -- First Occurre #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adaette <- synthetic_cdisc_dataset("latest", "adaette") +adsl <- random.cdisc.data::cadsl +adaette <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -96,12 +94,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAETTE <- synthetic_cdisc_dataset("latest", "adaette") + ADSL <- random.cdisc.data::cadsl + ADAETTE <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet05_all.qmd b/book/tables/adverse-events/aet05_all.qmd index c0ece0e99c..58a77f8793 100644 --- a/book/tables/adverse-events/aet05_all.qmd +++ b/book/tables/adverse-events/aet05_all.qmd @@ -14,12 +14,10 @@ subtitle: Adverse Event Rate Adjusted for Patient-Years at Risk -- All Occurrenc #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adaette <- synthetic_cdisc_dataset("latest", "adaette") +adsl <- random.cdisc.data::cadsl +adaette <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -97,12 +95,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAETTE <- synthetic_cdisc_dataset("latest", "adaette") + ADSL <- random.cdisc.data::cadsl + ADAETTE <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet06.qmd b/book/tables/adverse-events/aet06.qmd index 5a9c6e9bfd..94b1eb74a8 100644 --- a/book/tables/adverse-events/aet06.qmd +++ b/book/tables/adverse-events/aet06.qmd @@ -15,12 +15,10 @@ subtitle: Adverse Events by Baseline Characteristic library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") -adsub <- synthetic_cdisc_dataset("latest", "adsub") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae +adsub <- random.cdisc.data::cadsub adsub_bmi <- adsub %>% filter(PARAMCD == "BBMISI") %>% @@ -410,11 +408,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet06_smq.qmd b/book/tables/adverse-events/aet06_smq.qmd index dd539e5240..b5b9deb3a3 100644 --- a/book/tables/adverse-events/aet06_smq.qmd +++ b/book/tables/adverse-events/aet06_smq.qmd @@ -15,12 +15,10 @@ subtitle: Adverse Events by Baseline Characteristic, by SMQ and Preferred Term library(dplyr) library(tern) -library(scda) -library(scda.2022) library(stringr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae adsl_labels <- var_labels(adsl) adae_labels <- var_labels(adae) @@ -270,11 +268,9 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") %>% + ADSL <- random.cdisc.data::cadsl %>% mutate( AGE65 = case_when( AGE >= 65 ~ ">= 65", @@ -285,7 +281,7 @@ data <- within(data, { levels = c("< 65", ">= 65") ) ) - ADAE <- synthetic_cdisc_dataset("latest", "adae") %>% + ADAE <- random.cdisc.data::cadae %>% mutate( AGE65 = case_when( AGE >= 65 ~ ">= 65", diff --git a/book/tables/adverse-events/aet07.qmd b/book/tables/adverse-events/aet07.qmd index 917b1465ec..f804e8925a 100644 --- a/book/tables/adverse-events/aet07.qmd +++ b/book/tables/adverse-events/aet07.qmd @@ -17,11 +17,9 @@ For illustrative purposes, we will pre-process `AESDTH` in ADAE so there are no library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -133,12 +131,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet09.qmd b/book/tables/adverse-events/aet09.qmd index b21eef9b85..c85cddc51f 100644 --- a/book/tables/adverse-events/aet09.qmd +++ b/book/tables/adverse-events/aet09.qmd @@ -15,11 +15,9 @@ subtitle: Adverse Events Related to Study Drug library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -197,11 +195,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/adverse-events/aet09_smq.qmd b/book/tables/adverse-events/aet09_smq.qmd index e30063dc31..632341d025 100644 --- a/book/tables/adverse-events/aet09_smq.qmd +++ b/book/tables/adverse-events/aet09_smq.qmd @@ -15,12 +15,10 @@ subtitle: Adverse Events Related to Study Drug by Standardized MedDRA Query library(dplyr) library(tern) -library(scda) -library(scda.2022) library(stringr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing # levels. For details, refer to Teal and Study Data article. @@ -209,11 +207,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae }) datanames <- c("ADSL", "ADAE") datanames(data) <- datanames diff --git a/book/tables/adverse-events/aet10.qmd b/book/tables/adverse-events/aet10.qmd index d5e7bcd518..11bd173ee9 100644 --- a/book/tables/adverse-events/aet10.qmd +++ b/book/tables/adverse-events/aet10.qmd @@ -15,11 +15,9 @@ subtitle: Most Common ($\geq$ 5%) Adverse Events library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -128,11 +126,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAE <- synthetic_cdisc_dataset("latest", "adae") + ADSL <- random.cdisc.data::cadsl + ADAE <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/concomitant-medications/cmt01.qmd b/book/tables/concomitant-medications/cmt01.qmd index aa9420a4b1..3d97ad3cf0 100644 --- a/book/tables/concomitant-medications/cmt01.qmd +++ b/book/tables/concomitant-medications/cmt01.qmd @@ -15,13 +15,11 @@ subtitle: Concomitant Medications (GNEDrug Legacy Coding) library(dplyr) library(tern) -library(scda) -library(scda.2022) # The following tables require ADCM data structure that follows the legacy concomitant medication coding. # WHO coding is not used. -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adsl <- random.cdisc.data::cadsl +adcm <- random.cdisc.data::cadcm # Below step is to set up example data based on legacy standard. adcm <- adcm %>% @@ -270,12 +268,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADCM <- synthetic_cdisc_dataset("latest", "adcm") + ADSL <- random.cdisc.data::cadsl + ADCM <- random.cdisc.data::cadcm # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/concomitant-medications/cmt01a.qmd b/book/tables/concomitant-medications/cmt01a.qmd index be7b5e7501..2b6e7b2875 100644 --- a/book/tables/concomitant-medications/cmt01a.qmd +++ b/book/tables/concomitant-medications/cmt01a.qmd @@ -15,11 +15,9 @@ subtitle: Concomitant Medications by Medication Class and Preferred Name library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adsl <- random.cdisc.data::cadsl +adcm <- random.cdisc.data::cadcm adcm$CMSEQ <- as.factor(adcm$CMSEQ) @@ -262,11 +260,8 @@ adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADCM <- synthetic_cdisc_dataset("latest", "adcm") + ADSL <- random.cdisc.data::cadsl + ADCM <- random.cdisc.data::cadcm ADCM$CMSEQ <- as.integer(ADCM$CMSEQ) ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/concomitant-medications/cmt01b.qmd b/book/tables/concomitant-medications/cmt01b.qmd index 9996b2c2e2..f7afde4196 100644 --- a/book/tables/concomitant-medications/cmt01b.qmd +++ b/book/tables/concomitant-medications/cmt01b.qmd @@ -15,11 +15,9 @@ subtitle: Concomitant Medications by Medication Class and Preferred Name library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adsl <- random.cdisc.data::cadsl +adcm <- random.cdisc.data::cadcm adcm$CMSEQ <- as.factor(adcm$CMSEQ) @@ -286,11 +284,8 @@ adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADCM <- synthetic_cdisc_dataset("latest", "adcm") + ADSL <- random.cdisc.data::cadsl + ADCM <- random.cdisc.data::cadcm ADCM$CMSEQ <- as.integer(ADCM$CMSEQ) ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/concomitant-medications/cmt02_pt.qmd b/book/tables/concomitant-medications/cmt02_pt.qmd index 34681f53aa..f5ebfbe064 100644 --- a/book/tables/concomitant-medications/cmt02_pt.qmd +++ b/book/tables/concomitant-medications/cmt02_pt.qmd @@ -15,11 +15,9 @@ subtitle: Concomitant Medications by Preferred Name (WHODrug Coding) library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adcm <- synthetic_cdisc_dataset("latest", "adcm") +adsl <- random.cdisc.data::cadsl +adcm <- random.cdisc.data::cadcm adcm$CMSEQ <- as.factor(adcm$CMSEQ) @@ -88,11 +86,8 @@ adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADCM <- synthetic_cdisc_dataset("latest", "adcm") + ADSL <- random.cdisc.data::cadsl + ADCM <- random.cdisc.data::cadcm ADCM$CMSEQ <- as.integer(ADCM$CMSEQ) ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/deaths/dtht01.qmd b/book/tables/deaths/dtht01.qmd index c09d889b34..31d338d72e 100644 --- a/book/tables/deaths/dtht01.qmd +++ b/book/tables/deaths/dtht01.qmd @@ -14,11 +14,9 @@ subtitle: Deaths #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) %>% filter(SAFFL == "Y") diff --git a/book/tables/demography/dmt01.qmd b/book/tables/demography/dmt01.qmd index 773f379e52..9c37020786 100644 --- a/book/tables/demography/dmt01.qmd +++ b/book/tables/demography/dmt01.qmd @@ -14,14 +14,12 @@ subtitle: Demographics and Baseline Characteristics #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) library(tidyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -advs <- synthetic_cdisc_dataset("latest", "advs") -adsub <- synthetic_cdisc_dataset("latest", "adsub") +adsl <- random.cdisc.data::cadsl +advs <- random.cdisc.data::cadvs +adsub <- random.cdisc.data::cadsub # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -242,10 +240,7 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") + ADSL <- random.cdisc.data::cadsl # Include `EOSDY` and `DCSREAS` variables below because they contain missing data. stopifnot( diff --git a/book/tables/disclosures/disclosurest01.qmd b/book/tables/disclosures/disclosurest01.qmd index baca277361..1c5a6c397d 100644 --- a/book/tables/disclosures/disclosurest01.qmd +++ b/book/tables/disclosures/disclosurest01.qmd @@ -14,11 +14,9 @@ subtitle: Disclosures Outputs ```{r setup1, message = FALSE} library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -137,11 +135,9 @@ result ```{r setup2, message = FALSE} library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -197,11 +193,9 @@ result ```{r setup3, message = FALSE} library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl adsl_labels <- var_labels(adsl) # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. @@ -242,12 +236,10 @@ Trimming function `get_adae_trimmed` is defined to filter AEs with greater than ```{r setup4, message = FALSE} library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -332,11 +324,9 @@ For illustrative purposes, the `adae` data is filtered by arm "A: Drug X" here. ```{r setup5, message = FALSE} library(tern) -library(scda) -library(scda.2022) library(dplyr) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adae <- df_explicit_na(adae) @@ -397,12 +387,10 @@ result ```{r setup6, message = FALSE} library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae ``` #### Death Table diff --git a/book/tables/disclosures/eudrat01.qmd b/book/tables/disclosures/eudrat01.qmd index 60bdc3f53e..54761b235e 100644 --- a/book/tables/disclosures/eudrat01.qmd +++ b/book/tables/disclosures/eudrat01.qmd @@ -16,12 +16,10 @@ Define a trimming function `get_adae_trimmed` to filter for AEs of greater than #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/disclosures/eudrat02.qmd b/book/tables/disclosures/eudrat02.qmd index 498c1c6b40..64edb7fc2c 100644 --- a/book/tables/disclosures/eudrat02.qmd +++ b/book/tables/disclosures/eudrat02.qmd @@ -16,11 +16,9 @@ For illustrative purposes, the `adae` data is filtered by arm `A: Drug X` here. #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adae <- synthetic_cdisc_dataset("latest", "adae") +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adae <- df_explicit_na(adae) diff --git a/book/tables/disposition/dst01.qmd b/book/tables/disposition/dst01.qmd index da6c08e7b0..a1fef5fc32 100644 --- a/book/tables/disposition/dst01.qmd +++ b/book/tables/disposition/dst01.qmd @@ -14,12 +14,10 @@ subtitle: Patient Disposition #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) set.seed(1, kind = "Mersenne-Twister") -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # reorder EOSSTT factor levels so DISCONTINUED is the last level adsl <- df_explicit_na(adsl) %>% @@ -149,12 +147,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) set.seed(1, kind = "Mersenne-Twister") - ADSL <- synthetic_cdisc_dataset("latest", "adsl") + ADSL <- random.cdisc.data::cadsl ADSL <- df_explicit_na(ADSL) ADSL <- ADSL %>% mutate( diff --git a/book/tables/disposition/pdt01.qmd b/book/tables/disposition/pdt01.qmd index 22ae587327..4173eb1779 100644 --- a/book/tables/disposition/pdt01.qmd +++ b/book/tables/disposition/pdt01.qmd @@ -15,11 +15,9 @@ subtitle: Major Protocol Deviations library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -addv <- synthetic_cdisc_dataset("latest", "addv") +adsl <- random.cdisc.data::cadsl +addv <- random.cdisc.data::caddv # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -83,11 +81,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADDV <- synthetic_cdisc_dataset("latest", "addv") + ADSL <- random.cdisc.data::cadsl + ADDV <- random.cdisc.data::caddv # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/disposition/pdt02.qmd b/book/tables/disposition/pdt02.qmd index 3ab4ee01ca..60e7769c95 100644 --- a/book/tables/disposition/pdt02.qmd +++ b/book/tables/disposition/pdt02.qmd @@ -13,13 +13,11 @@ subtitle: Major Protocol Deviations Related to Epidemic/Pandemic ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -addv <- synthetic_cdisc_dataset("latest", "addv") +adsl <- random.cdisc.data::cadsl +addv <- random.cdisc.data::caddv adsl <- df_explicit_na(adsl) addv <- df_explicit_na(addv) diff --git a/book/tables/efficacy/aovt01.qmd b/book/tables/efficacy/aovt01.qmd index eb3cc8854d..febe738dc7 100644 --- a/book/tables/efficacy/aovt01.qmd +++ b/book/tables/efficacy/aovt01.qmd @@ -13,13 +13,11 @@ subtitle: ANCOVA for Multiple End Points ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -80,11 +78,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADQS <- synthetic_cdisc_dataset("latest", "adqs") + ADSL <- random.cdisc.data::cadsl + ADQS <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/aovt02.qmd b/book/tables/efficacy/aovt02.qmd index 23d6093672..375ab530c5 100644 --- a/book/tables/efficacy/aovt02.qmd +++ b/book/tables/efficacy/aovt02.qmd @@ -16,13 +16,11 @@ Only evaluable populations will be analyzed. ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -87,11 +85,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADQS <- synthetic_cdisc_dataset("latest", "adqs") + ADSL <- random.cdisc.data::cadsl + ADQS <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/aovt03.qmd b/book/tables/efficacy/aovt03.qmd index 310e379eef..e964e4b9ac 100644 --- a/book/tables/efficacy/aovt03.qmd +++ b/book/tables/efficacy/aovt03.qmd @@ -15,13 +15,11 @@ This example will focus on data from multiple visits and take the interaction be ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs adqs_in <- adqs %>% filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 5 DAY 36")) %>% diff --git a/book/tables/efficacy/cfbt01.qmd b/book/tables/efficacy/cfbt01.qmd index 15c2ca985f..3eec178b76 100644 --- a/book/tables/efficacy/cfbt01.qmd +++ b/book/tables/efficacy/cfbt01.qmd @@ -13,13 +13,11 @@ subtitle: Efficacy Data and Change from Baseline by Visit ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -108,11 +106,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADQS <- synthetic_cdisc_dataset("latest", "adqs") + ADSL <- random.cdisc.data::cadsl + ADQS <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/cmht01.qmd b/book/tables/efficacy/cmht01.qmd index 875aa2a542..4418de4fa5 100644 --- a/book/tables/efficacy/cmht01.qmd +++ b/book/tables/efficacy/cmht01.qmd @@ -14,12 +14,10 @@ subtitle: Cochran-Mantel-Haenszel (CMH) Summary #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -147,7 +145,7 @@ result <- build_table( result ``` -`r webr_code_labels <- c("setup", "variant2")` +`r webr_code_labels <- c("setup", "variant2")` {{< include ../../_utils/webr.qmd >}} ::: @@ -164,11 +162,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADRS <- synthetic_cdisc_dataset("latest", "adrs") + ADSL <- random.cdisc.data::cadsl + ADRS <- random.cdisc.data::cadrs }) datanames <- c("ADSL", "ADRS") datanames(data) <- datanames diff --git a/book/tables/efficacy/coxt01.qmd b/book/tables/efficacy/coxt01.qmd index bf00cafdf0..126eb8cae2 100644 --- a/book/tables/efficacy/coxt01.qmd +++ b/book/tables/efficacy/coxt01.qmd @@ -17,13 +17,11 @@ This ratio is referred to as the "hazard ratio" and is one of the most commonly ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adtte <- synthetic_cdisc_dataset("latest", "adtte") +adsl <- random.cdisc.data::cadsl +adtte <- random.cdisc.data::cadtte # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -214,11 +212,8 @@ arm_ref_comp <- list( ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADTTE <- synthetic_cdisc_dataset("latest", "adtte") + ADSL <- random.cdisc.data::cadsl + ADTTE <- random.cdisc.data::cadtte # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/coxt02.qmd b/book/tables/efficacy/coxt02.qmd index 2692540660..8541443fca 100644 --- a/book/tables/efficacy/coxt02.qmd +++ b/book/tables/efficacy/coxt02.qmd @@ -19,13 +19,11 @@ Since there is usually no pre-specified hypothesis testing for such analysis, th ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) library(broom) -adtte <- synthetic_cdisc_dataset("latest", "adtte") +adtte <- random.cdisc.data::cadtte # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adtte <- df_explicit_na(adtte) @@ -160,11 +158,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADTTE <- synthetic_cdisc_dataset("latest", "adtte") + ADSL <- random.cdisc.data::cadsl + ADTTE <- random.cdisc.data::cadtte }) datanames <- c("ADSL", "ADTTE") datanames(data) <- datanames diff --git a/book/tables/efficacy/dort01.qmd b/book/tables/efficacy/dort01.qmd index 2d4ab97b2f..45903b6401 100644 --- a/book/tables/efficacy/dort01.qmd +++ b/book/tables/efficacy/dort01.qmd @@ -13,13 +13,11 @@ subtitle: Duration of Response ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adtte <- synthetic_cdisc_dataset("latest", "adtte") +adsl <- random.cdisc.data::cadsl +adtte <- random.cdisc.data::cadtte # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -299,11 +297,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADTTE <- synthetic_cdisc_dataset("latest", "adtte") + ADSL <- random.cdisc.data::cadsl + ADTTE <- random.cdisc.data::cadtte # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/lgrt02.qmd b/book/tables/efficacy/lgrt02.qmd index 1023f52fbd..7626413e06 100644 --- a/book/tables/efficacy/lgrt02.qmd +++ b/book/tables/efficacy/lgrt02.qmd @@ -13,13 +13,11 @@ subtitle: Multi-Variable Logistic Regression ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adrs <- synthetic_cdisc_dataset("latest", "adrs") +adsl <- random.cdisc.data::cadsl +adrs <- random.cdisc.data::cadrs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -192,12 +190,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADRS <- synthetic_cdisc_dataset("latest", "adrs") %>% + ADSL <- random.cdisc.data::cadsl + ADRS <- random.cdisc.data::cadrs %>% filter(PARAMCD %in% c("BESRSPI", "INVET")) }) datanames <- c("ADSL", "ADRS") diff --git a/book/tables/efficacy/mmrmt01.qmd b/book/tables/efficacy/mmrmt01.qmd index 44ed9bf83d..e60ab4fd5a 100644 --- a/book/tables/efficacy/mmrmt01.qmd +++ b/book/tables/efficacy/mmrmt01.qmd @@ -15,12 +15,10 @@ subtitle: Tables for Mixed-Effect Model Repeated Measures Analysis library(dplyr) library(tern.mmrm) -library(scda) -library(scda.2022) library(broom) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adqs <- synthetic_cdisc_dataset("latest", "adqs") +adsl <- random.cdisc.data::cadsl +adqs <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -221,12 +219,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADQS <- synthetic_cdisc_dataset("latest", "adqs") %>% + ADSL <- random.cdisc.data::cadsl + ADQS <- random.cdisc.data::cadqs %>% filter(ABLFL != "Y" & ABLFL2 != "Y") %>% filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 3 DAY 22")) %>% mutate( diff --git a/book/tables/efficacy/onct05.qmd b/book/tables/efficacy/onct05.qmd index f568ffd8e3..38d629389e 100644 --- a/book/tables/efficacy/onct05.qmd +++ b/book/tables/efficacy/onct05.qmd @@ -15,11 +15,9 @@ subtitle: Objective Response Rate by Subgroup library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adrs <- synthetic_cdisc_dataset("latest", "adrs") +adsl <- random.cdisc.data::cadsl +adrs <- random.cdisc.data::cadrs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -178,11 +176,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADRS <- synthetic_cdisc_dataset("latest", "adrs") + ADSL <- random.cdisc.data::cadsl + ADRS <- random.cdisc.data::cadrs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/ratet01.qmd b/book/tables/efficacy/ratet01.qmd index 44bc468d63..b6de25b471 100644 --- a/book/tables/efficacy/ratet01.qmd +++ b/book/tables/efficacy/ratet01.qmd @@ -16,12 +16,10 @@ Only evaluable populations will be analyzed. ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -anl <- synthetic_cdisc_dataset("latest", "adtte") %>% +anl <- random.cdisc.data::cadtte %>% filter(PARAMCD == "TNE") # Ensure number of exacerbation is a factor and NAs are explicit missing levels. @@ -35,6 +33,7 @@ anl <- df_explicit_na(anl) ## {{< fa regular file-lines sm fw >}} Preview + ```{r variant1, test = list(result_v1 = "result"), eval = packageVersion("tern") >= "0.9.3.9005"} lyt <- basic_table(show_colcounts = TRUE) %>% split_cols_by("ARM", ref_group = "B: Placebo", split_fun = ref_group_position("first")) %>% diff --git a/book/tables/efficacy/rspt01.qmd b/book/tables/efficacy/rspt01.qmd index fafa971171..95efe12f81 100644 --- a/book/tables/efficacy/rspt01.qmd +++ b/book/tables/efficacy/rspt01.qmd @@ -15,11 +15,9 @@ subtitle: Best Overall Response library(dplyr) library(tern) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adrs <- synthetic_cdisc_dataset("latest", "adrs") +adsl <- random.cdisc.data::cadsl +adrs <- random.cdisc.data::cadrs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -299,12 +297,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADRS <- synthetic_cdisc_dataset("latest", "adrs") + ADSL <- random.cdisc.data::cadsl + ADRS <- random.cdisc.data::cadrs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/efficacy/ttet01.qmd b/book/tables/efficacy/ttet01.qmd index db9999beda..f41730d1a1 100644 --- a/book/tables/efficacy/ttet01.qmd +++ b/book/tables/efficacy/ttet01.qmd @@ -7,19 +7,17 @@ subtitle: Time-To-Event Summary {{< include ../../_utils/envir_hook.qmd >}} -:::::: {.panel-tabset} +:::: {.panel-tabset} ## Data Setup ```{r setup, message = FALSE} #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adtte <- synthetic_cdisc_dataset("latest", "adtte") +adsl <- random.cdisc.data::cadsl +adtte <- random.cdisc.data::cadtte # Ensure that character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -446,11 +444,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADTTE <- synthetic_cdisc_dataset("latest", "adtte") + ADSL <- random.cdisc.data::cadsl + ADTTE <- random.cdisc.data::cadtte # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) @@ -512,4 +507,4 @@ shinyApp(app$ui, app$server) {{< include ../../repro.qmd >}} -::::: +:::: diff --git a/book/tables/exposure/ext01.qmd b/book/tables/exposure/ext01.qmd index da0f71e625..9cfd7e987a 100644 --- a/book/tables/exposure/ext01.qmd +++ b/book/tables/exposure/ext01.qmd @@ -13,14 +13,12 @@ subtitle: Study Drug Exposure Table ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) library(tidyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adex <- synthetic_cdisc_dataset("latest", "adex") +adsl <- random.cdisc.data::cadsl +adex <- random.cdisc.data::cadex # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -230,12 +228,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEX <- synthetic_cdisc_dataset("latest", "adex") + ADSL <- random.cdisc.data::cadsl + ADEX <- random.cdisc.data::cadex adex_labels <- unname(col_labels(ADEX)) ADEX <- ADEX %>% filter(PARCAT1 == "OVERALL") %>% diff --git a/book/tables/lab-results/lbt01.qmd b/book/tables/lab-results/lbt01.qmd index b1520b4403..c9ca5205f2 100644 --- a/book/tables/lab-results/lbt01.qmd +++ b/book/tables/lab-results/lbt01.qmd @@ -15,13 +15,11 @@ In order to generate the `LBT01` standard tabulation, the `adlb` dataset may be ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -99,17 +97,15 @@ result ## {{< fa regular file-lines fa-sm fa-fw >}} Preview + ```{r teal, opts.label = c("skip_if_testing", "app"), eval = packageVersion("teal.modules.clinical") >= "0.9.0.9007"} library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/lab-results/lbt02.qmd b/book/tables/lab-results/lbt02.qmd index 7a686daaae..dfe63d25f1 100644 --- a/book/tables/lab-results/lbt02.qmd +++ b/book/tables/lab-results/lbt02.qmd @@ -14,12 +14,10 @@ subtitle: Laboratory Test Results by Visit #| code-fold: show # Preparation of an illustrative dataset -library(scda) -library(scda.2022) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adlb_labels <- var_labels(adlb) @@ -79,11 +77,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/lab-results/lbt03.qmd b/book/tables/lab-results/lbt03.qmd index 9339774f1f..af4d6eb7f2 100644 --- a/book/tables/lab-results/lbt03.qmd +++ b/book/tables/lab-results/lbt03.qmd @@ -15,13 +15,11 @@ For illustration purposes, this example focuses on "C-Reactive Protein Measureme ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -136,11 +134,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- df_explicit_na(synthetic_cdisc_dataset("latest", "adsl")) - ADLB <- df_explicit_na(synthetic_cdisc_dataset("latest", "adlb")) %>% + ADSL <- df_explicit_na(random.cdisc.data::cadsl) + ADLB <- df_explicit_na(random.cdisc.data::cadlb) %>% filter( !(ARM == "B: Placebo" & AVISIT == "WEEK 1 DAY 8"), AVISIT != "SCREENING" diff --git a/book/tables/lab-results/lbt04.qmd b/book/tables/lab-results/lbt04.qmd index ad250b5b3c..6c654d406e 100644 --- a/book/tables/lab-results/lbt04.qmd +++ b/book/tables/lab-results/lbt04.qmd @@ -13,13 +13,11 @@ subtitle: Laboratory Abnormalities Not Present at Baseline ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -75,11 +73,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") %>% + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb %>% col_relabel(PARAM = "Laboratory Test", ANRIND = "Direction of Abnormality") }) datanames <- c("ADSL", "ADLB") diff --git a/book/tables/lab-results/lbt05.qmd b/book/tables/lab-results/lbt05.qmd index 10938e0654..80b769cbf7 100644 --- a/book/tables/lab-results/lbt05.qmd +++ b/book/tables/lab-results/lbt05.qmd @@ -13,13 +13,11 @@ subtitle: Laboratory Abnormalities with Single and Replicated Marked ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/lab-results/lbt06.qmd b/book/tables/lab-results/lbt06.qmd index 01fc760e42..a1a49c9dc1 100644 --- a/book/tables/lab-results/lbt06.qmd +++ b/book/tables/lab-results/lbt06.qmd @@ -13,13 +13,11 @@ subtitle: Laboratory Abnormalities by Visit and Baseline Status ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/lab-results/lbt07.qmd b/book/tables/lab-results/lbt07.qmd index c4a33ebba8..20561c2e9d 100644 --- a/book/tables/lab-results/lbt07.qmd +++ b/book/tables/lab-results/lbt07.qmd @@ -13,14 +13,12 @@ subtitle: Laboratory Test Results with Highest NCI CTCAE Grade Post-Baseline ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) library(forcats) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adlb_labels <- var_labels(adlb) @@ -124,12 +122,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") %>% + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb %>% filter(!AVISIT %in% c("SCREENING", "BASELINE")) }) datanames <- c("ADSL", "ADLB") diff --git a/book/tables/lab-results/lbt08.qmd b/book/tables/lab-results/lbt08.qmd index cc6168c44e..7464ee0ccc 100644 --- a/book/tables/lab-results/lbt08.qmd +++ b/book/tables/lab-results/lbt08.qmd @@ -13,13 +13,11 @@ subtitle: Laboratory Test Results with Highest NCI CTCAE Grade at Any Time ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adlb <- adlb %>% mutate( diff --git a/book/tables/lab-results/lbt09.qmd b/book/tables/lab-results/lbt09.qmd index c07f6b10f7..88aa292f19 100644 --- a/book/tables/lab-results/lbt09.qmd +++ b/book/tables/lab-results/lbt09.qmd @@ -13,12 +13,10 @@ subtitle: Liver Laboratory Tests -- Patients with Elevated Post-Baseline AST or ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adhy <- synthetic_cdisc_dataset("latest", "adhy") +adhy <- random.cdisc.data::cadhy # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adhy_liver <- df_explicit_na(adhy) diff --git a/book/tables/lab-results/lbt10.qmd b/book/tables/lab-results/lbt10.qmd index e95869e190..7415bfca0e 100644 --- a/book/tables/lab-results/lbt10.qmd +++ b/book/tables/lab-results/lbt10.qmd @@ -13,13 +13,11 @@ subtitle: Liver Laboratory Tests -- Patients with Elevated Post-Baseline AST or ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adhy <- synthetic_cdisc_dataset("latest", "adhy") +adsl <- random.cdisc.data::cadsl +adhy <- random.cdisc.data::cadhy adhy_liver <- adhy %>% filter(PARAMCD %in% c( diff --git a/book/tables/lab-results/lbt10_bl.qmd b/book/tables/lab-results/lbt10_bl.qmd index bb10a0451c..ef44deb999 100644 --- a/book/tables/lab-results/lbt10_bl.qmd +++ b/book/tables/lab-results/lbt10_bl.qmd @@ -13,13 +13,11 @@ subtitle: Liver Laboratory Tests -- Patients with Elevated Post-Baseline AST or ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adhy <- synthetic_cdisc_dataset("latest", "adhy") +adsl <- random.cdisc.data::cadsl +adhy <- random.cdisc.data::cadhy adhy_liver <- adhy %>% filter(PARAMCD %in% c( diff --git a/book/tables/lab-results/lbt11.qmd b/book/tables/lab-results/lbt11.qmd index e41ab5fc41..19e5087de9 100644 --- a/book/tables/lab-results/lbt11.qmd +++ b/book/tables/lab-results/lbt11.qmd @@ -14,12 +14,10 @@ subtitle: Time to First Increase in Liver Laboratory Test Result Meeting Hy's La #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adaette <- synthetic_cdisc_dataset("latest", "adaette") +adsl <- random.cdisc.data::cadsl +adaette <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -165,12 +163,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAETTE <- synthetic_cdisc_dataset("latest", "adaette") + ADSL <- random.cdisc.data::cadsl + ADAETTE <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/lab-results/lbt11_bl.qmd b/book/tables/lab-results/lbt11_bl.qmd index 24a0876d0c..bc8bafa594 100644 --- a/book/tables/lab-results/lbt11_bl.qmd +++ b/book/tables/lab-results/lbt11_bl.qmd @@ -14,12 +14,10 @@ subtitle: Time to First Increase in Liver Laboratory Test Result Meeting Hy's La #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adaette <- synthetic_cdisc_dataset("latest", "adaette") +adsl <- random.cdisc.data::cadsl +adaette <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -165,12 +163,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADAETTE <- synthetic_cdisc_dataset("latest", "adaette") + ADSL <- random.cdisc.data::cadsl + ADAETTE <- random.cdisc.data::cadaette # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/lab-results/lbt12.qmd b/book/tables/lab-results/lbt12.qmd index dd72221bac..d6053435ec 100644 --- a/book/tables/lab-results/lbt12.qmd +++ b/book/tables/lab-results/lbt12.qmd @@ -13,12 +13,10 @@ subtitle: Liver Laboratory Tests by Time on Treatment -- Patients with Elevated ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adhy <- synthetic_cdisc_dataset("latest", "adhy") +adhy <- random.cdisc.data::cadhy anl <- adhy anl$APERIODC <- as.factor(anl$APERIODC) # to ensure the table is built even if there is no patients after filtering diff --git a/book/tables/lab-results/lbt12_bl.qmd b/book/tables/lab-results/lbt12_bl.qmd index 45ad964c79..42929fcdcc 100644 --- a/book/tables/lab-results/lbt12_bl.qmd +++ b/book/tables/lab-results/lbt12_bl.qmd @@ -13,12 +13,10 @@ subtitle: Liver Laboratory Tests by Time on Treatment -- Patients with Elevated ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adhy <- synthetic_cdisc_dataset("latest", "adhy") +adhy <- random.cdisc.data::cadhy anl <- adhy anl$APERIODC <- as.factor(anl$APERIODC) # to ensure the table is built even if there is no patients after filtering diff --git a/book/tables/lab-results/lbt13.qmd b/book/tables/lab-results/lbt13.qmd index e6e6a549e3..eaa79b4fc7 100644 --- a/book/tables/lab-results/lbt13.qmd +++ b/book/tables/lab-results/lbt13.qmd @@ -18,13 +18,11 @@ Otherwise please follow the pre-processing steps below before applying the layou ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adsl <- df_explicit_na(adsl) adlb <- df_explicit_na(adlb) @@ -461,11 +459,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb }) datanames <- c("ADSL", "ADLB") datanames(data) <- datanames diff --git a/book/tables/lab-results/lbt14.qmd b/book/tables/lab-results/lbt14.qmd index d9c6c7b8ff..0abe5fadd6 100644 --- a/book/tables/lab-results/lbt14.qmd +++ b/book/tables/lab-results/lbt14.qmd @@ -18,13 +18,11 @@ Otherwise please follow the pre-processing steps below before applying the layou ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adsl <- df_explicit_na(adsl) adlb <- df_explicit_na(adlb) @@ -363,11 +361,8 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) - - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb }) datanames <- c("ADSL", "ADLB") datanames(data) <- datanames diff --git a/book/tables/lab-results/lbt15.qmd b/book/tables/lab-results/lbt15.qmd index a78095b34e..8c5f45daf5 100644 --- a/book/tables/lab-results/lbt15.qmd +++ b/book/tables/lab-results/lbt15.qmd @@ -10,19 +10,17 @@ subtitle: Laboratory Test Shifts to NCI CTCAE Grade 3-4 Post-Baseline :::: {.panel-tabset} ## Data Setup -Because the `scda` dataset `adlb` doesn't have the `PARCAT1` variable, this variable is created from `LBCAT` in pre-processing. +Because the `random.cdisc.data` dataset `adlb` doesn't have the `PARCAT1` variable, this variable is created from `LBCAT` in pre-processing. ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(tern) library(dplyr) library(forcats) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adlb <- synthetic_cdisc_dataset("latest", "adlb") +adsl <- random.cdisc.data::cadsl +adlb <- random.cdisc.data::cadlb adlb <- adlb %>% mutate( @@ -135,13 +133,11 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) library(forcats) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADLB <- synthetic_cdisc_dataset("latest", "adlb") %>% + ADSL <- random.cdisc.data::cadsl + ADLB <- random.cdisc.data::cadlb %>% mutate( ANRIND = fct_collapse(ATOXGR, "LOW" = c("-3", "-4"), diff --git a/book/tables/medical-history/mht01.qmd b/book/tables/medical-history/mht01.qmd index 9451aae426..fbadb10c68 100644 --- a/book/tables/medical-history/mht01.qmd +++ b/book/tables/medical-history/mht01.qmd @@ -15,11 +15,9 @@ subtitle: Medical History library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -admh <- synthetic_cdisc_dataset("latest", "admh") +adsl <- random.cdisc.data::cadsl +admh <- random.cdisc.data::cadmh # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -202,13 +200,11 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") %>% + ADSL <- random.cdisc.data::cadsl %>% filter(SAFFL == "Y") - ADMH <- synthetic_cdisc_dataset("latest", "admh") %>% + ADMH <- random.cdisc.data::cadmh %>% filter(SAFFL == "Y" & MHBODSYS != "" & MHDECOD != "") }) datanames <- c("ADSL", "ADMH") diff --git a/book/tables/pharmacokinetic/pkct01.qmd b/book/tables/pharmacokinetic/pkct01.qmd index 5e8ed8a624..bbf5551545 100644 --- a/book/tables/pharmacokinetic/pkct01.qmd +++ b/book/tables/pharmacokinetic/pkct01.qmd @@ -13,14 +13,12 @@ subtitle: Summary Concentration Table ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") %>% +adsl <- random.cdisc.data::cadsl %>% filter(ACTARM == "A: Drug X") -adpc <- synthetic_cdisc_dataset("latest", "adpc") %>% +adpc <- random.cdisc.data::cadpc %>% filter(ACTARM == "A: Drug X", PARAM == "Plasma Drug X") # Setting up the data diff --git a/book/tables/pharmacokinetic/pkpt02.qmd b/book/tables/pharmacokinetic/pkpt02.qmd index ea6df8e170..ec5c816387 100644 --- a/book/tables/pharmacokinetic/pkpt02.qmd +++ b/book/tables/pharmacokinetic/pkpt02.qmd @@ -13,12 +13,10 @@ subtitle: Pharmacokinetic Parameter Summary -- Plasma/Serum/Blood PK Parameters ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(PPSPEC == "Plasma", AVISIT == "CYCLE 1 DAY 1") ``` @@ -109,4 +107,5 @@ result ``` {{< include ../../repro.qmd >}} + :::: diff --git a/book/tables/pharmacokinetic/pkpt03.qmd b/book/tables/pharmacokinetic/pkpt03.qmd index 9fde0c177c..da9a5dd618 100644 --- a/book/tables/pharmacokinetic/pkpt03.qmd +++ b/book/tables/pharmacokinetic/pkpt03.qmd @@ -14,13 +14,11 @@ subtitle: Pharmacokinetic Parameter Summary of Plasma by Treatment (Stats in Col ```{r setup, message = FALSE, opts.label = ifelse(packageVersion("tern") < "0.9.3.9020", "skip_test_strict", "")} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) # Preprocess analysis data ---- -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(PPSPEC == "Plasma") %>% filter(AVISIT %in% c("CYCLE 1 DAY 1", "CYCLE 1 DAY 2")) %>% @@ -29,7 +27,7 @@ adpp <- adpp %>% mutate(PARAM = reorder(PARAM, TLG_ORDER)) # Preprocess subject-level data ---- -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # Workaround needed to include (N=xx) population counts # Repeat ADSL by the number of levels in AVISIT diff --git a/book/tables/pharmacokinetic/pkpt04.qmd b/book/tables/pharmacokinetic/pkpt04.qmd index 91a7b483e2..84af4786e1 100644 --- a/book/tables/pharmacokinetic/pkpt04.qmd +++ b/book/tables/pharmacokinetic/pkpt04.qmd @@ -13,12 +13,10 @@ subtitle: Pharmacokinetic Parameter Summary -- Urine PK Parameters (Stats in Row ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(PPSPEC == "Urine", AVISIT == "CYCLE 1 DAY 1") ``` diff --git a/book/tables/pharmacokinetic/pkpt05.qmd b/book/tables/pharmacokinetic/pkpt05.qmd index 767e293f29..0d10a1a196 100644 --- a/book/tables/pharmacokinetic/pkpt05.qmd +++ b/book/tables/pharmacokinetic/pkpt05.qmd @@ -13,12 +13,10 @@ subtitle: Summary of Urinary PK Parameters by Treatment Arm (Stats in Columns) ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(PPSPEC == "Urine", AVISIT == "CYCLE 1 DAY 1") ``` diff --git a/book/tables/pharmacokinetic/pkpt06.qmd b/book/tables/pharmacokinetic/pkpt06.qmd index d970631d9f..6840d6bb81 100644 --- a/book/tables/pharmacokinetic/pkpt06.qmd +++ b/book/tables/pharmacokinetic/pkpt06.qmd @@ -13,13 +13,11 @@ subtitle: Pharmacokinetic Parameter Summary -- Dose-Normalized PK Parameters (St ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) library(stringr) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(AVISIT == "CYCLE 1 DAY 1", str_detect(tolower(PARAM), regex("norm by dose", ignore_case = TRUE))) ``` diff --git a/book/tables/pharmacokinetic/pkpt07.qmd b/book/tables/pharmacokinetic/pkpt07.qmd index 908d18ea64..6cf5b4b5e6 100644 --- a/book/tables/pharmacokinetic/pkpt07.qmd +++ b/book/tables/pharmacokinetic/pkpt07.qmd @@ -13,13 +13,11 @@ subtitle: Table of Mean Dose-Normalized Selected Pharmacokinetic Parameters (Sta ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) library(stringr) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(AVISIT == "CYCLE 1 DAY 1", str_detect(tolower(PARAM), regex("norm by dose", ignore_case = TRUE))) ``` diff --git a/book/tables/pharmacokinetic/pkpt08.qmd b/book/tables/pharmacokinetic/pkpt08.qmd index 9e73b5067a..6ff86a0ab5 100644 --- a/book/tables/pharmacokinetic/pkpt08.qmd +++ b/book/tables/pharmacokinetic/pkpt08.qmd @@ -14,11 +14,9 @@ subtitle: Pharmacokinetic Parameter Summary of Cumulative Amount of Drug Elimina #| code-fold: show library(dplyr) -library(scda) -library(scda.2022) library(tern) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp adpp <- adpp %>% filter(PPSTINT != "NA" & PPENINT != "NA") %>% diff --git a/book/tables/pharmacokinetic/pkpt11.qmd b/book/tables/pharmacokinetic/pkpt11.qmd index f45e262449..963aa8302a 100644 --- a/book/tables/pharmacokinetic/pkpt11.qmd +++ b/book/tables/pharmacokinetic/pkpt11.qmd @@ -14,12 +14,10 @@ subtitle: Pharmacokinetic Parameter Estimated Ratios of Geometric Means and 90% ```{r setup, message = FALSE, opts.label = ifelse(packageVersion("tern") < "0.9.3.9020", "skip_test_strict", "")} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adpp <- synthetic_cdisc_dataset("latest", "adpp") +adpp <- random.cdisc.data::cadpp # Comparator Dose - A: Drug X arm_var <- "TRT01A" diff --git a/book/tables/risk-management-plan/rmpt01.qmd b/book/tables/risk-management-plan/rmpt01.qmd index 1fcd7fcb94..5e5ab5b890 100644 --- a/book/tables/risk-management-plan/rmpt01.qmd +++ b/book/tables/risk-management-plan/rmpt01.qmd @@ -14,18 +14,16 @@ subtitle: Duration of Exposure for Risk Management Plan #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adex <- synthetic_cdisc_dataset("latest", "adex") +adsl <- random.cdisc.data::cadsl +adex <- random.cdisc.data::cadex # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) adex <- df_explicit_na(adex) -# Simulate ADEX records with PARAMCD == "TDURD" as they are not in sample scda dataset. +# Simulate ADEX records with PARAMCD == "TDURD" as they are not in sample random.cdisc.data dataset. set.seed(1, kind = "Mersenne-Twister") adex2 <- adex %>% distinct(USUBJID, .keep_all = TRUE) %>% @@ -99,12 +97,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEX <- synthetic_cdisc_dataset("latest", "adex") + ADSL <- random.cdisc.data::cadsl + ADEX <- random.cdisc.data::cadex labels <- col_labels(ADEX) set.seed(1, kind = "Mersenne-Twister") diff --git a/book/tables/risk-management-plan/rmpt03.qmd b/book/tables/risk-management-plan/rmpt03.qmd index dea5539d88..5e044d4835 100644 --- a/book/tables/risk-management-plan/rmpt03.qmd +++ b/book/tables/risk-management-plan/rmpt03.qmd @@ -14,18 +14,16 @@ subtitle: Extent of Exposure by Age Group and Gender for Risk Management Plan #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adex <- synthetic_cdisc_dataset("latest", "adex") +adsl <- random.cdisc.data::cadsl +adex <- random.cdisc.data::cadex # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) adex <- df_explicit_na(adex) -# Simulate ADEX records with PARAMCD == "TDURD" as they are not in sample scda dataset. +# Simulate ADEX records with PARAMCD == "TDURD" as they are not in sample random.cdisc.data dataset. set.seed(1, kind = "Mersenne-Twister") adex2 <- adex %>% distinct(USUBJID, .keep_all = TRUE) %>% @@ -139,12 +137,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEX <- synthetic_cdisc_dataset("latest", "adex") + ADSL <- random.cdisc.data::cadsl + ADEX <- random.cdisc.data::cadex labels <- col_labels(ADEX) set.seed(1, kind = "Mersenne-Twister") diff --git a/book/tables/risk-management-plan/rmpt04.qmd b/book/tables/risk-management-plan/rmpt04.qmd index eb24a9851d..19794c6477 100644 --- a/book/tables/risk-management-plan/rmpt04.qmd +++ b/book/tables/risk-management-plan/rmpt04.qmd @@ -14,18 +14,16 @@ subtitle: Extent of Exposure by Ethnic Origin for Risk Management Plan #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adex <- synthetic_cdisc_dataset("latest", "adex") +adsl <- random.cdisc.data::cadsl +adex <- random.cdisc.data::cadex # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) adex <- df_explicit_na(adex) -# Simulate ADEX records with PARAMCD == "TDURD" as they are not in sample scda dataset. +# Simulate ADEX records with PARAMCD == "TDURD" as they are not in sample random.cdisc.data dataset. set.seed(1, kind = "Mersenne-Twister") adex2 <- adex %>% distinct(USUBJID, .keep_all = TRUE) %>% @@ -88,12 +86,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEX <- synthetic_cdisc_dataset("latest", "adex") + ADSL <- random.cdisc.data::cadsl + ADEX <- random.cdisc.data::cadex labels <- col_labels(ADEX) set.seed(1, kind = "Mersenne-Twister") diff --git a/book/tables/risk-management-plan/rmpt05.qmd b/book/tables/risk-management-plan/rmpt05.qmd index 1774e556cf..464ceb1e14 100644 --- a/book/tables/risk-management-plan/rmpt05.qmd +++ b/book/tables/risk-management-plan/rmpt05.qmd @@ -14,12 +14,10 @@ subtitle: Extent of Exposure by Race for Risk Management Plan #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adex <- synthetic_cdisc_dataset("latest", "adex") +adsl <- random.cdisc.data::cadsl +adex <- random.cdisc.data::cadex # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -90,12 +88,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADEX <- synthetic_cdisc_dataset("latest", "adex") + ADSL <- random.cdisc.data::cadsl + ADEX <- random.cdisc.data::cadex labels <- col_labels(ADEX) set.seed(1, kind = "Mersenne-Twister") diff --git a/book/tables/risk-management-plan/rmpt06.qmd b/book/tables/risk-management-plan/rmpt06.qmd index eb9dc3a08a..ab4dccff63 100644 --- a/book/tables/risk-management-plan/rmpt06.qmd +++ b/book/tables/risk-management-plan/rmpt06.qmd @@ -18,11 +18,9 @@ Some new variables are added to these datasets to create the desired tables. library(tern) library(dplyr) -library(scda) -library(scda.2022) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -adae <- synthetic_cdisc_dataset("latest", "adae") +adsl <- random.cdisc.data::cadsl +adae <- random.cdisc.data::cadae # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) diff --git a/book/tables/safety/enrollment01.qmd b/book/tables/safety/enrollment01.qmd index ae2200d10d..d1139b9fa9 100644 --- a/book/tables/safety/enrollment01.qmd +++ b/book/tables/safety/enrollment01.qmd @@ -15,11 +15,9 @@ subtitle: Enrollment Variants library(dplyr) library(forcats) -library(scda) -library(scda.2022) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") +adsl <- random.cdisc.data::cadsl # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -159,17 +157,16 @@ Note that for this module application, only the variables passed into `by_vars` Variables passed into `analyze_vars` are additionally used when `row_groups` is deselected. + ```{r teal, opts.label = c("skip_if_testing", "app"), eval = packageVersion("teal.modules.clinical") >= "0.9.0.9003"} library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") + ADSL <- random.cdisc.data::cadsl # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) diff --git a/book/tables/vital-signs/vst01.qmd b/book/tables/vital-signs/vst01.qmd index b795a7c048..1d43af0da3 100644 --- a/book/tables/vital-signs/vst01.qmd +++ b/book/tables/vital-signs/vst01.qmd @@ -14,12 +14,10 @@ subtitle: Vital Sign Results and Change from Baseline by Visit #| code-fold: show library(tern) -library(scda) -library(scda.2022) library(dplyr) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -advs <- synthetic_cdisc_dataset("latest", "advs") +adsl <- random.cdisc.data::cadsl +advs <- random.cdisc.data::cadvs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. adsl <- df_explicit_na(adsl) @@ -136,18 +134,17 @@ result ## {{< fa regular file-lines fa-sm fa-fw >}} Preview + ```{r teal, opts.label = c("skip_if_testing", "app"), eval = packageVersion("teal.modules.clinical") >= "0.9.0.9007"} library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADVS <- synthetic_cdisc_dataset("latest", "advs") + ADSL <- random.cdisc.data::cadsl + ADVS <- random.cdisc.data::cadvs advs_label <- col_labels(ADVS) # post-baseline diff --git a/book/tables/vital-signs/vst02.qmd b/book/tables/vital-signs/vst02.qmd index 192f8639ad..0601b9aba0 100644 --- a/book/tables/vital-signs/vst02.qmd +++ b/book/tables/vital-signs/vst02.qmd @@ -13,13 +13,11 @@ subtitle: Vital Sign Abnormalities ```{r setup, message = FALSE} #| code-fold: show -library(scda) -library(scda.2022) library(dplyr) library(tern) -adsl <- synthetic_cdisc_dataset("latest", "adsl") -advs <- synthetic_cdisc_dataset("latest", "advs") +adsl <- random.cdisc.data::cadsl +advs <- random.cdisc.data::cadvs # Ensure character variables are converted to factors and empty strings # and NAs are explicit missing levels. @@ -102,12 +100,10 @@ library(teal.modules.clinical) ## Data reproducible code data <- teal_data() data <- within(data, { - library(scda) - library(scda.2022) library(dplyr) - ADSL <- synthetic_cdisc_dataset("latest", "adsl") - ADVS <- synthetic_cdisc_dataset("latest", "advs") %>% + ADSL <- random.cdisc.data::cadsl + ADVS <- random.cdisc.data::cadvs %>% mutate(ONTRTFL = ifelse(AVISIT %in% c("SCREENING", "BASELINE"), "", "Y")) %>% col_relabel(ONTRTFL = "On Treatment Record Flag") }) diff --git a/package/DESCRIPTION b/package/DESCRIPTION index 78ec1c9aaa..d4b65e3c56 100644 --- a/package/DESCRIPTION +++ b/package/DESCRIPTION @@ -25,12 +25,11 @@ Suggests: lubridate, nestcolor, quarto (>= 1.4), + random.cdisc.data, renv, rlistings, rtables, scales, - scda, - scda.2022, shinylive, stats, stringr, diff --git a/package/staged_dependencies.yaml b/package/staged_dependencies.yaml index c53a486c91..94afeff34c 100644 --- a/package/staged_dependencies.yaml +++ b/package/staged_dependencies.yaml @@ -4,11 +4,8 @@ current_repo: host: https://github.com subdir: package upstream_repos: - insightsengineering/scda: - repo: insightsengineering/scda - host: https://github.com - insightsengineering/scda.2022: - repo: insightsengineering/scda.2022 + insightsengineering/random.cdisc.data: + repo: insightsengineering/random.cdisc.data host: https://github.com insightsengineering/teal.modules.clinical: repo: insightsengineering/teal.modules.clinical