The user can select different plotting_choices depending on their preference. To demonstrate, separate plots are produced with a maximum of 3 observations each.
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.
Here, patients’ individual baseline values will be shown for reference. Note that users can provide their own custom theme to the function via the ggtheme argument.
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.
library(teal.modules.clinical)## Data reproducible codedata <-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)# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <-df_explicit_na(ADSL) ADLB <-df_explicit_na(ADLB) %>%filter(AVISIT !="SCREENING")})datanames <-c("ADSL", "ADLB")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADLB <- data[["ADLB"]]## Setup Appapp <-init(data = data,modules =modules(tm_g_ipp(label ="Individual Patient Plot",dataname ="ADLB",arm_var =choices_selected(value_choices(ADLB, c("ARMCD")),"ARM A" ),paramcd =choices_selected(value_choices(ADLB, "PARAMCD"),"ALT" ),aval_var =choices_selected(variable_choices(ADLB, c("AVAL")),"AVAL" ),avalu_var =choices_selected(variable_choices(ADLB, c("AVALU")),"AVALU",fixed =TRUE ),id_var =choices_selected(variable_choices(ADLB, c("USUBJID")),"USUBJID",fixed =TRUE ),visit_var =choices_selected(variable_choices(ADLB, c("AVISIT")),"AVISIT" ),baseline_var =choices_selected(variable_choices(ADLB, c("BASE")),"BASE",fixed =TRUE ),add_baseline_hline =FALSE,separate_by_obs =FALSE ) ))shinyApp(app$ui, app$server)
Experimental use!
shinylive allow you to modify to run shiny application entirely in the web browser. Modify the code below and click re-run the app to see the results. The performance is slighly worse and some of the features (e.g. downloading) might not work at all.