library(scda)library(scda.2022)library(dplyr)library(tern)adhy <-synthetic_cdisc_dataset("latest", "adhy")anl <- adhyanl$APERIODC <-as.factor(anl$APERIODC) # to ensure the table is built even if there is no patients after filteringanl$ACTARM <-as.factor(anl$ACTARM) # to ensure the table is built even if there is no patients after filteringanl <- anl %>%filter( SAFFL =="Y", PARAMCD %in%c("ASTPULN", "ALTPULN", "ALTASTPU") & AVISIT =="POST-BASELINE" ) %>%mutate(ARM_AVALC =factor(case_when( AVALC =="Y"~as.character(ACTARM),TRUE~"Criteria not met" ),levels =c(levels(anl$ACTARM), "Criteria not met") ),PARAM =factor(case_when( PARAMCD =="ASTPULN"~"AST >3x ULN", PARAMCD =="ALTPULN"~"ALT >3x ULN", PARAMCD =="ALTASTPU"~"AST >3x ULN or ALT >x3 ULN" ),levels =c("AST >3x ULN", "ALT >3x ULN", "AST >3x ULN or ALT >x3 ULN") ),TITLE =factor("First Elevated Result Occurring During") )anl <-df_explicit_na(anl)
result <-basic_table() %>%split_cols_by("TITLE") %>%split_cols_by("APERIODC") %>%split_rows_by("PARAM") %>%split_rows_by("ACTARM", split_fun = drop_split_levels, child_labels ="hidden") %>%count_occurrences("ARM_AVALC", .stats ="fraction", denom ="n", drop =TRUE) %>%build_table(anl)criteria_fun <-function(tr) { row_label <-obj_label(tr) dplyr::if_else(row_label =="Criteria not met", TRUE, FALSE)}result <- result %>%trim_rows(criteria = criteria_fun)result
First Elevated Result Occurring During
PERIOD 1 PERIOD 2
----------------------------------------------------------------------
AST >3x ULN
A: Drug X 11/134 (8.2%) 21/134 (15.7%)
B: Placebo 17/134 (12.7%) 16/134 (11.9%)
C: Combination 10/132 (7.6%) 8/132 (6.1%)
ALT >3x ULN
A: Drug X 14/134 (10.4%) 8/134 (6.0%)
B: Placebo 24/134 (17.9%) 18/134 (13.4%)
C: Combination 16/132 (12.1%) 10/132 (7.6%)
AST >3x ULN or ALT >x3 ULN
A: Drug X 14/134 (10.4%) 15/134 (11.2%)
B: Placebo 8/134 (6.0%) 13/134 (9.7%)
C: Combination 11/132 (8.3%) 12/132 (9.1%)
Experimental use!
WebR is a tool allowing you to run R code in the web browser. Modify the code below and click run to see the results. Altenatively, copy the code and click here to open WebR in a new tab.
Code
# In progress
Timestamp
Code
Sys.time()
[1] "2024-05-11 17:34:43 UTC"
Session Info
Code
sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
locale:
[1] C
time zone: Etc/UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tern_0.9.4 rtables_0.6.7 magrittr_2.0.3 formatters_0.5.6
[5] dplyr_1.1.4 scda.2022_0.1.5 scda_0.1.6
loaded via a namespace (and not attached):
[1] Matrix_1.7-0 gtable_0.3.5 jsonlite_1.8.8 compiler_4.4.0
[5] brio_1.1.5 tidyselect_1.2.1 tidyr_1.3.1 splines_4.4.0
[9] scales_1.3.0 yaml_2.3.8 fastmap_1.1.1 lattice_0.22-6
[13] ggplot2_3.5.1 R6_2.5.1 generics_0.1.3 knitr_1.46
[17] forcats_1.0.0 rbibutils_2.2.16 htmlwidgets_1.6.4 backports_1.4.1
[21] checkmate_2.3.1 tibble_3.2.1 munsell_0.5.1 pillar_1.9.0
[25] rlang_1.1.3 utf8_1.2.4 testthat_3.2.1.1 stringi_1.8.4
[29] broom_1.0.5 xfun_0.43 cli_3.6.2 Rdpack_2.6
[33] digest_0.6.35 grid_4.4.0 lifecycle_1.0.4 vctrs_0.6.5
[37] evaluate_0.23 glue_1.7.0 codetools_0.2-20 survival_3.6-4
[41] colorspace_2.1-0 fansi_1.0.6 purrr_1.0.2 rmarkdown_2.26
[45] tools_4.4.0 pkgconfig_2.0.3 htmltools_0.5.8.1
.lock file
Download the .lock file and use renv::restore() on it to recreate environment used to generate this website.