Title: | R Package of Teal Module for TLG Functions in Osprey |
---|---|
Description: | Community efforts to collect teal modules for TLGs defined in the osprey package. The teal modules add an encoding panel to interactively change the encoding within teal. |
Authors: | Nina Qi [aut, cre], Dawid Kaledkowski [aut], Chendi Liao [aut], Liming Li [aut], Konrad Pagacz [aut], Molly He [ctb], Carolyn Zhang [ctb], Tina Cho [ctb], F. Hoffmann-La Roche AG [cph, fnd] |
Maintainer: | Nina Qi <[email protected]> |
License: | Apache License 2.0 | file LICENSE |
Version: | 0.1.16 |
Built: | 2024-10-30 05:18:04 UTC |
Source: | https://github.com/insightsengineering/teal.osprey |
AE
variables in AE
osprey functions
Automatically switch variable labels for standard AE
variables in AE
osprey functions
label_aevar(x)
label_aevar(x)
x |
variable key |
plot_decorate_output(id)
plot_decorate_output(id)
id |
( |
Utility function for quick filter
quick_filter(filter_opt, ANL)
quick_filter(filter_opt, ANL)
filter_opt |
vector of string names of flag variable to filter (keep Y rows only) |
ANL |
input dataset |
a filtered dataframe
Carolyn Zhang (zhanc107) [email protected]
This is used in tm_g_ae_oview
and tm_g_events_term_id
.
srv_g_decorate( id, plot_id = "out", plt = reactive(NULL), plot_height, plot_width )
srv_g_decorate( id, plot_id = "out", plt = reactive(NULL), plot_height, plot_width )
id |
( |
plot_id |
( |
plt |
( |
plot_height |
optional, ( |
plot_width |
optional, ( |
AE
overviewDisplay the AE
overview plot as a shiny module
tm_g_ae_oview( label, dataname, arm_var, flag_var_anl, fontsize = c(5, 3, 7), plot_height = c(600L, 200L, 2000L), plot_width = NULL )
tm_g_ae_oview( label, dataname, arm_var, flag_var_anl, fontsize = c(5, 3, 7), plot_height = c(600L, 200L, 2000L), plot_width = NULL )
label |
( |
dataname |
( |
arm_var |
( |
flag_var_anl |
( |
fontsize |
( |
plot_height |
( |
plot_width |
( |
the teal::module()
object.
library(nestcolor) ADSL <- osprey::rADSL ADAE <- osprey::rADAE # Add additional dummy causality flags. add_event_flags <- function(dat) { dat <- dat %>% dplyr::mutate( TMPFL_SER = AESER == "Y", TMPFL_REL = AEREL == "Y", TMPFL_GR5 = AETOXGR == "5", AEREL1 = (AEREL == "Y" & ACTARM == "A: Drug X"), AEREL2 = (AEREL == "Y" & ACTARM == "B: Placebo") ) labels <- c( "Serious AE", "Related AE", "Grade 5 AE", "AE related to A: Drug X", "AE related to B: Placebo" ) cols <- c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2") for (i in seq_along(labels)) { attr(dat[[cols[i]]], "label") <- labels[i] } dat } ADAE <- ADAE %>% add_event_flags() app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE add_event_flags <- function(dat) { dat <- dat %>% dplyr::mutate( TMPFL_SER = AESER == 'Y', TMPFL_REL = AEREL == 'Y', TMPFL_GR5 = AETOXGR == '5', AEREL1 = (AEREL == 'Y' & ACTARM == 'A: Drug X'), AEREL2 = (AEREL == 'Y' & ACTARM == 'B: Placebo') ) labels <- c( 'Serious AE', 'Related AE', 'Grade 5 AE', 'AE related to A: Drug X', 'AE related to B: Placebo' ) cols <- c('TMPFL_SER', 'TMPFL_REL', 'TMPFL_GR5', 'AEREL1', 'AEREL2') for (i in seq_along(labels)) { attr(dat[[cols[i]]], 'label') <- labels[i] } dat } # Generating user-defined event flags. ADAE <- ADAE %>% add_event_flags()" ), check = TRUE ), modules = modules( tm_g_ae_oview( label = "AE Overview", dataname = "ADAE", arm_var = teal.transform::choices_selected( selected = "ACTARM", choices = c("ACTARM", "ACTARMCD") ), flag_var_anl = teal.transform::choices_selected( selected = "AEREL1", choices = teal.transform::variable_choices( ADAE, c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2") ), ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) ADSL <- osprey::rADSL ADAE <- osprey::rADAE # Add additional dummy causality flags. add_event_flags <- function(dat) { dat <- dat %>% dplyr::mutate( TMPFL_SER = AESER == "Y", TMPFL_REL = AEREL == "Y", TMPFL_GR5 = AETOXGR == "5", AEREL1 = (AEREL == "Y" & ACTARM == "A: Drug X"), AEREL2 = (AEREL == "Y" & ACTARM == "B: Placebo") ) labels <- c( "Serious AE", "Related AE", "Grade 5 AE", "AE related to A: Drug X", "AE related to B: Placebo" ) cols <- c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2") for (i in seq_along(labels)) { attr(dat[[cols[i]]], "label") <- labels[i] } dat } ADAE <- ADAE %>% add_event_flags() app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE add_event_flags <- function(dat) { dat <- dat %>% dplyr::mutate( TMPFL_SER = AESER == 'Y', TMPFL_REL = AEREL == 'Y', TMPFL_GR5 = AETOXGR == '5', AEREL1 = (AEREL == 'Y' & ACTARM == 'A: Drug X'), AEREL2 = (AEREL == 'Y' & ACTARM == 'B: Placebo') ) labels <- c( 'Serious AE', 'Related AE', 'Grade 5 AE', 'AE related to A: Drug X', 'AE related to B: Placebo' ) cols <- c('TMPFL_SER', 'TMPFL_REL', 'TMPFL_GR5', 'AEREL1', 'AEREL2') for (i in seq_along(labels)) { attr(dat[[cols[i]]], 'label') <- labels[i] } dat } # Generating user-defined event flags. ADAE <- ADAE %>% add_event_flags()" ), check = TRUE ), modules = modules( tm_g_ae_oview( label = "AE Overview", dataname = "ADAE", arm_var = teal.transform::choices_selected( selected = "ACTARM", choices = c("ACTARM", "ACTARMCD") ), flag_var_anl = teal.transform::choices_selected( selected = "AEREL1", choices = teal.transform::variable_choices( ADAE, c("TMPFL_SER", "TMPFL_REL", "TMPFL_GR5", "AEREL1", "AEREL2") ), ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
AE
by subgroupsDisplay the AE
by subgroups plot as a teal module
tm_g_ae_sub( label, dataname, arm_var, group_var, plot_height = c(600L, 200L, 2000L), plot_width = NULL, fontsize = c(5, 3, 7) )
tm_g_ae_sub( label, dataname, arm_var, group_var, plot_height = c(600L, 200L, 2000L), plot_width = NULL, fontsize = c(5, 3, 7) )
label |
( |
dataname |
( |
arm_var |
( |
group_var |
( |
plot_height |
( |
plot_width |
( |
fontsize |
( |
the teal::module()
object.
Liming Li (Lil128) [email protected]
Molly He (hey59) [email protected]
# Example using stream (ADaM) dataset ADSL <- osprey::rADSL ADAE <- osprey::rADAE app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"), check = TRUE ), modules = modules( tm_g_ae_sub( label = "AE by Subgroup", dataname = "ADAE", arm_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("ACTARM", "ACTARMCD") ), group_var = teal.transform::choices_selected( selected = c("SEX", "REGION1", "RACE"), choices = c("SEX", "REGION1", "RACE") ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
# Example using stream (ADaM) dataset ADSL <- osprey::rADSL ADAE <- osprey::rADAE app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"), check = TRUE ), modules = modules( tm_g_ae_sub( label = "AE by Subgroup", dataname = "ADAE", arm_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("ACTARM", "ACTARMCD") ), group_var = teal.transform::choices_selected( selected = c("SEX", "REGION1", "RACE"), choices = c("SEX", "REGION1", "RACE") ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
Display butterfly plot as a shiny module
tm_g_butterfly( label, dataname, filter_var = NULL, right_var, left_var, category_var, color_by_var, count_by_var, facet_var = NULL, sort_by_var = teal.transform::choices_selected(selected = "count", choices = c("count", "alphabetical")), legend_on = TRUE, plot_height = c(600L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
tm_g_butterfly( label, dataname, filter_var = NULL, right_var, left_var, category_var, color_by_var, count_by_var, facet_var = NULL, sort_by_var = teal.transform::choices_selected(selected = "count", choices = c("count", "alphabetical")), legend_on = TRUE, plot_height = c(600L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
filter_var |
( |
right_var |
( |
left_var |
( |
category_var |
( |
color_by_var |
( |
count_by_var |
( |
facet_var |
( |
sort_by_var |
( |
legend_on |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
filter_var
option is designed to work in conjunction with
filtering function provided by teal
(encoding panel on the right
hand side of the shiny app). It can be used as quick access to predefined
subsets of the domain datasets (not subject-level dataset) to be used for
analysis, denoted by an value of "Y". Each variable within the
filter_var_choices
is expected to contain values of either "Y" or
"N". If multiple variables are selected as filter_var
, only
observations with "Y" value in each and every selected variables will be
used for subsequent analysis. Flag variables (from ADaM
datasets) can be
used directly as filter.
the teal::module()
object.
Carolyn Zhang (zhanc107) [email protected]
Chendi Liao (liaoc10) [email protected]
# Example using stream (ADaM) dataset library(dplyr) library(nestcolor) set.seed(23) ADSL <- osprey::rADSL ADAE <- osprey::rADAE ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), "UG")) ADAE <- mutate( ADAE, flag1 = ifelse(AETOXGR == 1, 1, 0), flag2 = ifelse(AETOXGR == 2, 1, 0), flag3 = ifelse(AETOXGR == 3, 1, 0), flag1_filt = rep("Y", n()) ) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL set.seed(23) ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), 'UG'))" ), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE ADAE <- mutate(ADAE, flag1 = ifelse(AETOXGR == 1, 1, 0), flag2 = ifelse(AETOXGR == 2, 1, 0), flag3 = ifelse(AETOXGR == 3, 1, 0), flag1_filt = rep('Y', n()))" ), check = TRUE ), modules = modules( tm_g_butterfly( label = "Butterfly Plot", dataname = "ADAE", right_var = teal.transform::choices_selected( selected = "SEX", choices = c("SEX", "ARM", "RACE") ), left_var = teal.transform::choices_selected( selected = "RACE", choices = c("SEX", "ARM", "RACE") ), category_var = teal.transform::choices_selected( selected = "AEBODSYS", choices = c("AEDECOD", "AEBODSYS") ), color_by_var = teal.transform::choices_selected( selected = "AETOXGR", choices = c("AETOXGR", "None") ), count_by_var = teal.transform::choices_selected( selected = "# of patients", choices = c("# of patients", "# of AEs") ), facet_var = teal.transform::choices_selected( selected = NULL, choices = c("RACE", "SEX", "ARM") ), sort_by_var = teal.transform::choices_selected( selected = "count", choices = c("count", "alphabetical") ), legend_on = TRUE, plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
# Example using stream (ADaM) dataset library(dplyr) library(nestcolor) set.seed(23) ADSL <- osprey::rADSL ADAE <- osprey::rADAE ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), "UG")) ADAE <- mutate( ADAE, flag1 = ifelse(AETOXGR == 1, 1, 0), flag2 = ifelse(AETOXGR == 2, 1, 0), flag3 = ifelse(AETOXGR == 3, 1, 0), flag1_filt = rep("Y", n()) ) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL set.seed(23) ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), 'UG'))" ), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE ADAE <- mutate(ADAE, flag1 = ifelse(AETOXGR == 1, 1, 0), flag2 = ifelse(AETOXGR == 2, 1, 0), flag3 = ifelse(AETOXGR == 3, 1, 0), flag1_filt = rep('Y', n()))" ), check = TRUE ), modules = modules( tm_g_butterfly( label = "Butterfly Plot", dataname = "ADAE", right_var = teal.transform::choices_selected( selected = "SEX", choices = c("SEX", "ARM", "RACE") ), left_var = teal.transform::choices_selected( selected = "RACE", choices = c("SEX", "ARM", "RACE") ), category_var = teal.transform::choices_selected( selected = "AEBODSYS", choices = c("AEDECOD", "AEBODSYS") ), color_by_var = teal.transform::choices_selected( selected = "AETOXGR", choices = c("AETOXGR", "None") ), count_by_var = teal.transform::choices_selected( selected = "# of patients", choices = c("# of patients", "# of AEs") ), facet_var = teal.transform::choices_selected( selected = NULL, choices = c("RACE", "SEX", "ARM") ), sort_by_var = teal.transform::choices_selected( selected = "count", choices = c("count", "alphabetical") ), legend_on = TRUE, plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
Display Events by Term plot as a shiny module
tm_g_events_term_id( label, dataname, term_var, arm_var, fontsize = c(5, 3, 7), plot_height = c(600L, 200L, 2000L), plot_width = NULL )
tm_g_events_term_id( label, dataname, term_var, arm_var, fontsize = c(5, 3, 7), plot_height = c(600L, 200L, 2000L), plot_width = NULL )
label |
( |
dataname |
( |
term_var |
|
arm_var |
( |
fontsize |
( |
plot_height |
( |
plot_width |
( |
the teal::module()
object.
Liming Li (lil128) [email protected]
Molly He (hey59) [email protected]
library(nestcolor) ADSL <- osprey::rADSL ADAE <- osprey::rADAE app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"), check = TRUE ), modules = modules( tm_g_events_term_id( label = "Common AE", dataname = "ADAE", term_var = teal.transform::choices_selected( selected = "AEDECOD", choices = c( "AEDECOD", "AETERM", "AEHLT", "AELLT", "AEBODSYS" ) ), arm_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("ACTARM", "ACTARMCD") ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) ADSL <- osprey::rADSL ADAE <- osprey::rADAE app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"), check = TRUE ), modules = modules( tm_g_events_term_id( label = "Common AE", dataname = "ADAE", term_var = teal.transform::choices_selected( selected = "AEDECOD", choices = c( "AEDECOD", "AETERM", "AEHLT", "AELLT", "AEBODSYS" ) ), arm_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("ACTARM", "ACTARMCD") ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
Display the heatmap by grade as a shiny module
tm_g_heat_bygrade( label, sl_dataname, ex_dataname, ae_dataname, cm_dataname = NA, id_var, visit_var, ongo_var, anno_var, heat_var, conmed_var = NULL, fontsize = c(5, 3, 7), plot_height = c(600L, 200L, 2000L), plot_width = NULL )
tm_g_heat_bygrade( label, sl_dataname, ex_dataname, ae_dataname, cm_dataname = NA, id_var, visit_var, ongo_var, anno_var, heat_var, conmed_var = NULL, fontsize = c(5, 3, 7), plot_height = c(600L, 200L, 2000L), plot_width = NULL )
label |
( |
sl_dataname |
( |
ex_dataname |
( |
ae_dataname |
( |
cm_dataname |
( |
id_var |
( |
visit_var |
( |
ongo_var |
( |
anno_var |
( |
heat_var |
( |
conmed_var |
( |
fontsize |
( |
plot_height |
( |
plot_width |
( |
the teal::module()
object.
library(dplyr) library(nestcolor) ADSL <- osprey::rADSL %>% slice(1:30) ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID) ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID) ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID) # This preprocess is only to force legacy standard on ADCM ADCM <- ADCM %>% select(-starts_with("ATC")) %>% unique() # function to derive AVISIT from ADEX add_visit <- function(data_need_visit) { visit_dates <- ADEX %>% filter(PARAMCD == "DOSE") %>% distinct(USUBJID, AVISIT, ASTDTM) %>% group_by(USUBJID) %>% arrange(ASTDTM) %>% mutate(next_vis = lead(ASTDTM), is_last = ifelse(is.na(next_vis), TRUE, FALSE)) %>% rename(this_vis = ASTDTM) data_visit <- data_need_visit %>% select(USUBJID, ASTDTM) %>% left_join(visit_dates, by = "USUBJID") %>% filter(ASTDTM > this_vis & (ASTDTM < next_vis | is_last == TRUE)) %>% left_join(data_need_visit) %>% distinct() return(data_visit) } # derive AVISIT for ADAE and ADCM ADAE <- add_visit(ADAE) ADCM <- add_visit(ADCM) # derive ongoing status variable for ADEX ADEX <- ADEX %>% filter(PARCAT1 == "INDIVIDUAL") %>% mutate(ongo_status = (EOSSTT == "ONGOING")) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL), cdisc_dataset("ADEX", ADEX), cdisc_dataset("ADAE", ADAE), cdisc_dataset("ADCM", ADCM, keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")), code = " ADSL <- osprey::rADSL %>% slice(1:30) ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID) ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID) ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID) ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique() ADEX <- ADEX %>% filter(PARCAT1 == 'INDIVIDUAL') %>% mutate(ongo_status = (EOSSTT == 'ONGOING')) add_visit <- function(data_need_visit) { visit_dates <- ADEX %>% filter(PARAMCD == 'DOSE') %>% distinct(USUBJID, AVISIT, ASTDTM) %>% group_by(USUBJID) %>% arrange(ASTDTM) %>% mutate(next_vis = lead(ASTDTM), is_last = ifelse(is.na(next_vis), TRUE, FALSE)) %>% rename(this_vis = ASTDTM) data_visit <- data_need_visit %>% select(USUBJID, ASTDTM) %>% left_join(visit_dates, by = 'USUBJID') %>% filter(ASTDTM > this_vis & (ASTDTM < next_vis | is_last == TRUE)) %>% left_join(data_need_visit) %>% distinct() return(data_visit) } ADAE <- add_visit(ADAE) ADCM <- add_visit(ADCM) ", check = TRUE ), modules = modules( tm_g_heat_bygrade( label = "Heatmap by grade", sl_dataname = "ADSL", ex_dataname = "ADEX", ae_dataname = "ADAE", cm_dataname = "ADCM", id_var = teal.transform::choices_selected( selected = "USUBJID", choices = c("USUBJID", "SUBJID") ), visit_var = teal.transform::choices_selected( selected = "AVISIT", choices = c("AVISIT") ), ongo_var = teal.transform::choices_selected( selected = "ongo_status", choices = c("ongo_status") ), anno_var = teal.transform::choices_selected( selected = c("SEX", "COUNTRY"), choices = c("SEX", "COUNTRY", "USUBJID") ), heat_var = teal.transform::choices_selected( selected = "AETOXGR", choices = c("AETOXGR") ), conmed_var = teal.transform::choices_selected( selected = "CMDECOD", choices = c("CMDECOD") ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) library(nestcolor) ADSL <- osprey::rADSL %>% slice(1:30) ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID) ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID) ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID) # This preprocess is only to force legacy standard on ADCM ADCM <- ADCM %>% select(-starts_with("ATC")) %>% unique() # function to derive AVISIT from ADEX add_visit <- function(data_need_visit) { visit_dates <- ADEX %>% filter(PARAMCD == "DOSE") %>% distinct(USUBJID, AVISIT, ASTDTM) %>% group_by(USUBJID) %>% arrange(ASTDTM) %>% mutate(next_vis = lead(ASTDTM), is_last = ifelse(is.na(next_vis), TRUE, FALSE)) %>% rename(this_vis = ASTDTM) data_visit <- data_need_visit %>% select(USUBJID, ASTDTM) %>% left_join(visit_dates, by = "USUBJID") %>% filter(ASTDTM > this_vis & (ASTDTM < next_vis | is_last == TRUE)) %>% left_join(data_need_visit) %>% distinct() return(data_visit) } # derive AVISIT for ADAE and ADCM ADAE <- add_visit(ADAE) ADCM <- add_visit(ADCM) # derive ongoing status variable for ADEX ADEX <- ADEX %>% filter(PARCAT1 == "INDIVIDUAL") %>% mutate(ongo_status = (EOSSTT == "ONGOING")) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL), cdisc_dataset("ADEX", ADEX), cdisc_dataset("ADAE", ADAE), cdisc_dataset("ADCM", ADCM, keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")), code = " ADSL <- osprey::rADSL %>% slice(1:30) ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID) ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID) ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID) ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique() ADEX <- ADEX %>% filter(PARCAT1 == 'INDIVIDUAL') %>% mutate(ongo_status = (EOSSTT == 'ONGOING')) add_visit <- function(data_need_visit) { visit_dates <- ADEX %>% filter(PARAMCD == 'DOSE') %>% distinct(USUBJID, AVISIT, ASTDTM) %>% group_by(USUBJID) %>% arrange(ASTDTM) %>% mutate(next_vis = lead(ASTDTM), is_last = ifelse(is.na(next_vis), TRUE, FALSE)) %>% rename(this_vis = ASTDTM) data_visit <- data_need_visit %>% select(USUBJID, ASTDTM) %>% left_join(visit_dates, by = 'USUBJID') %>% filter(ASTDTM > this_vis & (ASTDTM < next_vis | is_last == TRUE)) %>% left_join(data_need_visit) %>% distinct() return(data_visit) } ADAE <- add_visit(ADAE) ADCM <- add_visit(ADCM) ", check = TRUE ), modules = modules( tm_g_heat_bygrade( label = "Heatmap by grade", sl_dataname = "ADSL", ex_dataname = "ADEX", ae_dataname = "ADAE", cm_dataname = "ADCM", id_var = teal.transform::choices_selected( selected = "USUBJID", choices = c("USUBJID", "SUBJID") ), visit_var = teal.transform::choices_selected( selected = "AVISIT", choices = c("AVISIT") ), ongo_var = teal.transform::choices_selected( selected = "ongo_status", choices = c("ongo_status") ), anno_var = teal.transform::choices_selected( selected = c("SEX", "COUNTRY"), choices = c("SEX", "COUNTRY", "USUBJID") ), heat_var = teal.transform::choices_selected( selected = "AETOXGR", choices = c("AETOXGR") ), conmed_var = teal.transform::choices_selected( selected = "CMDECOD", choices = c("CMDECOD") ), plot_height = c(600, 200, 2000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
Display patient profile plot as a shiny module
tm_g_patient_profile( label = "Patient Profile Plot", patient_id, sl_dataname, ex_dataname = NA, ae_dataname = NA, rs_dataname = NA, cm_dataname = NA, lb_dataname = NA, sl_start_date, ex_var = NULL, ae_var = NULL, ae_line_col_var = NULL, ae_line_col_opt = NULL, rs_var = NULL, cm_var = NULL, lb_var = NULL, x_limit = "-28, 365", plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
tm_g_patient_profile( label = "Patient Profile Plot", patient_id, sl_dataname, ex_dataname = NA, ae_dataname = NA, rs_dataname = NA, cm_dataname = NA, lb_dataname = NA, sl_start_date, ex_var = NULL, ae_var = NULL, ae_line_col_var = NULL, ae_line_col_opt = NULL, rs_var = NULL, cm_var = NULL, lb_var = NULL, x_limit = "-28, 365", plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
label |
( |
patient_id |
( |
sl_dataname |
( |
ex_dataname , ae_dataname , rs_dataname , cm_dataname , lb_dataname
|
( |
sl_start_date |
( |
ex_var |
( |
ae_var |
( |
ae_line_col_var |
( |
ae_line_col_opt |
aesthetic values to map color values
(named vector to map color values to each name).
If not |
rs_var |
( |
cm_var |
( |
lb_var |
( |
x_limit |
a single |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
As the patient profile module plots different domains in one plot, the study day (x-axis)
is derived for consistency based the start date of user's choice in the app (for example,
ADSL.RANDDT
or ADSL.TRTSDT
):
In ADAE
, ADEX
, and ADCM
, it would be study day based on ASTDT
and/or
AENDT
in reference to the start date
In ADRS
and ADLB
, it would be study day based on ADT
in reference to
the start date
the teal::module()
object.
Xuefeng Hou (houx14) [email protected]
Tina Cho (chot) [email protected]
Molly He (hey59) [email protected]
Ting Qi (qit3) [email protected]
library(nestcolor) ADSL <- osprey::rADSL ADAE <- osprey::rADAE %>% mutate( ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM) ) ADCM <- osprey::rADCM %>% mutate( ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM) ) # The step below is to pre-process ADCM to legacy standard ADCM <- ADCM %>% select(-starts_with("ATC")) %>% unique() ADRS <- osprey::rADRS %>% mutate(ADT = as.Date(ADTM)) ADEX <- osprey::rADEX %>% mutate( ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM) ) ADLB <- osprey::rADLB %>% mutate( ADT = as.Date(ADTM), LBSTRESN = as.numeric(LBSTRESC) ) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADRS", ADRS, code = "ADRS <- osprey::rADRS %>% mutate(ADT = as.Date(ADTM))"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE %>% mutate(ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM))" ), cdisc_dataset("ADCM", ADCM, code = "ADCM <- osprey::rADCM %>% mutate(ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM)) ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()", keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD") ), cdisc_dataset("ADLB", ADLB, code = "ADLB <- osprey::rADLB %>% mutate(ADT = as.Date(ADTM), LBSTRESN = as.numeric(LBSTRESC))" ), cdisc_dataset("ADEX", ADEX, code = "ADEX <- osprey::rADEX %>% mutate(ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM))" ), check = FALSE # set FALSE here to keep run time of example short, should be set to TRUE ), modules = modules( tm_g_patient_profile( label = "Patient Profile Plot", patient_id = teal.transform::choices_selected( choices = unique(ADSL$USUBJID), selected = unique(ADSL$USUBJID)[1] ), sl_dataname = "ADSL", ex_dataname = "ADEX", ae_dataname = "ADAE", rs_dataname = "ADRS", cm_dataname = "ADCM", lb_dataname = "ADLB", sl_start_date = teal.transform::choices_selected( selected = "TRTSDTM", choices = c("TRTSDTM", "RANDDT") ), ex_var = teal.transform::choices_selected( selected = "PARCAT2", choices = "PARCAT2" ), ae_var = teal.transform::choices_selected( selected = "AEDECOD", choices = c("AEDECOD", "AESOC") ), ae_line_col_var = teal.transform::choices_selected( selected = "AESER", choices = c("AESER", "AEREL") ), ae_line_col_opt = c("Y" = "red", "N" = "blue"), rs_var = teal.transform::choices_selected( selected = "PARAMCD", choices = "PARAMCD" ), cm_var = teal.transform::choices_selected( selected = "CMDECOD", choices = c("CMDECOD", "CMCAT") ), lb_var = teal.transform::choices_selected( selected = "LBTESTCD", choices = c("LBTESTCD", "LBCAT") ), x_limit = "-28, 750", plot_height = c(1200, 400, 5000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) ADSL <- osprey::rADSL ADAE <- osprey::rADAE %>% mutate( ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM) ) ADCM <- osprey::rADCM %>% mutate( ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM) ) # The step below is to pre-process ADCM to legacy standard ADCM <- ADCM %>% select(-starts_with("ATC")) %>% unique() ADRS <- osprey::rADRS %>% mutate(ADT = as.Date(ADTM)) ADEX <- osprey::rADEX %>% mutate( ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM) ) ADLB <- osprey::rADLB %>% mutate( ADT = as.Date(ADTM), LBSTRESN = as.numeric(LBSTRESC) ) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADRS", ADRS, code = "ADRS <- osprey::rADRS %>% mutate(ADT = as.Date(ADTM))"), cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE %>% mutate(ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM))" ), cdisc_dataset("ADCM", ADCM, code = "ADCM <- osprey::rADCM %>% mutate(ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM)) ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()", keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD") ), cdisc_dataset("ADLB", ADLB, code = "ADLB <- osprey::rADLB %>% mutate(ADT = as.Date(ADTM), LBSTRESN = as.numeric(LBSTRESC))" ), cdisc_dataset("ADEX", ADEX, code = "ADEX <- osprey::rADEX %>% mutate(ASTDT = as.Date(ASTDTM), AENDT = as.Date(AENDTM))" ), check = FALSE # set FALSE here to keep run time of example short, should be set to TRUE ), modules = modules( tm_g_patient_profile( label = "Patient Profile Plot", patient_id = teal.transform::choices_selected( choices = unique(ADSL$USUBJID), selected = unique(ADSL$USUBJID)[1] ), sl_dataname = "ADSL", ex_dataname = "ADEX", ae_dataname = "ADAE", rs_dataname = "ADRS", cm_dataname = "ADCM", lb_dataname = "ADLB", sl_start_date = teal.transform::choices_selected( selected = "TRTSDTM", choices = c("TRTSDTM", "RANDDT") ), ex_var = teal.transform::choices_selected( selected = "PARCAT2", choices = "PARCAT2" ), ae_var = teal.transform::choices_selected( selected = "AEDECOD", choices = c("AEDECOD", "AESOC") ), ae_line_col_var = teal.transform::choices_selected( selected = "AESER", choices = c("AESER", "AEREL") ), ae_line_col_opt = c("Y" = "red", "N" = "blue"), rs_var = teal.transform::choices_selected( selected = "PARAMCD", choices = "PARAMCD" ), cm_var = teal.transform::choices_selected( selected = "CMDECOD", choices = c("CMDECOD", "CMCAT") ), lb_var = teal.transform::choices_selected( selected = "LBTESTCD", choices = c("LBTESTCD", "LBCAT") ), x_limit = "-28, 750", plot_height = c(1200, 400, 5000) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
Display spider plot as a shiny module
tm_g_spiderplot( label, dataname, paramcd, x_var, y_var, marker_var, line_colorby_var, xfacet_var = NULL, yfacet_var = NULL, vref_line = NULL, href_line = NULL, anno_txt_var = TRUE, legend_on = FALSE, plot_height = c(600L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
tm_g_spiderplot( label, dataname, paramcd, x_var, y_var, marker_var, line_colorby_var, xfacet_var = NULL, yfacet_var = NULL, vref_line = NULL, href_line = NULL, anno_txt_var = TRUE, legend_on = FALSE, plot_height = c(600L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
paramcd |
( |
x_var |
x-axis variables |
y_var |
y-axis variables |
marker_var |
variable dictates marker symbol |
line_colorby_var |
variable dictates line color |
xfacet_var |
variable for x facets |
yfacet_var |
variable for y facets |
vref_line |
vertical reference lines |
href_line |
horizontal reference lines |
anno_txt_var |
annotation text |
legend_on |
boolean value for whether legend is displayed |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
the teal::module()
object.
Carolyn Zhang (zhanc107) [email protected]
Chendi Liao (liaoc10) [email protected]
# Example using stream (ADaM) dataset library(dplyr) library(nestcolor) ADSL <- osprey::rADSL ADTR <- osprey::rADTR app <- teal::init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADTR", ADTR, code = "ADTR <- osprey::rADTR", keys = c("STUDYID", "USUBJID", "PARAMCD", "AVISIT") ), check = TRUE ), modules = modules( tm_g_spiderplot( label = "Spider plot", dataname = "ADTR", paramcd = teal.transform::choices_selected( choices = "SLDINV", selected = "SLDINV" ), x_var = teal.transform::choices_selected( choices = "ADY", selected = "ADY" ), y_var = teal.transform::choices_selected( choices = c("PCHG", "CHG", "AVAL"), selected = "PCHG" ), marker_var = teal.transform::choices_selected( choices = c("SEX", "RACE", "USUBJID"), selected = "SEX" ), line_colorby_var = teal.transform::choices_selected( choices = c("SEX", "USUBJID", "RACE"), selected = "SEX" ), xfacet_var = teal.transform::choices_selected( choices = c("SEX", "ARM"), selected = "SEX" ), yfacet_var = teal.transform::choices_selected( choices = c("SEX", "ARM"), selected = "ARM" ), vref_line = "10, 37", href_line = "-20, 0" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
# Example using stream (ADaM) dataset library(dplyr) library(nestcolor) ADSL <- osprey::rADSL ADTR <- osprey::rADTR app <- teal::init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"), cdisc_dataset("ADTR", ADTR, code = "ADTR <- osprey::rADTR", keys = c("STUDYID", "USUBJID", "PARAMCD", "AVISIT") ), check = TRUE ), modules = modules( tm_g_spiderplot( label = "Spider plot", dataname = "ADTR", paramcd = teal.transform::choices_selected( choices = "SLDINV", selected = "SLDINV" ), x_var = teal.transform::choices_selected( choices = "ADY", selected = "ADY" ), y_var = teal.transform::choices_selected( choices = c("PCHG", "CHG", "AVAL"), selected = "PCHG" ), marker_var = teal.transform::choices_selected( choices = c("SEX", "RACE", "USUBJID"), selected = "SEX" ), line_colorby_var = teal.transform::choices_selected( choices = c("SEX", "USUBJID", "RACE"), selected = "SEX" ), xfacet_var = teal.transform::choices_selected( choices = c("SEX", "ARM"), selected = "SEX" ), yfacet_var = teal.transform::choices_selected( choices = c("SEX", "ARM"), selected = "ARM" ), vref_line = "10, 37", href_line = "-20, 0" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
Swimlane
PlotThis is teal module that generates a swimlane
plot (bar plot with markers) for ADaM
data
tm_g_swimlane( label, dataname, bar_var, bar_color_var = NULL, sort_var = NULL, marker_pos_var = NULL, marker_shape_var = NULL, marker_shape_opt = NULL, marker_color_var = NULL, marker_color_opt = NULL, anno_txt_var = NULL, vref_line = NULL, plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL, x_label = "Time from First Treatment (Day)" )
tm_g_swimlane( label, dataname, bar_var, bar_color_var = NULL, sort_var = NULL, marker_pos_var = NULL, marker_shape_var = NULL, marker_shape_opt = NULL, marker_color_var = NULL, marker_color_opt = NULL, anno_txt_var = NULL, vref_line = NULL, plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL, x_label = "Time from First Treatment (Day)" )
label |
( |
dataname |
analysis data used for plotting, needs to be available in the list passed to the |
bar_var |
( |
bar_color_var |
( |
sort_var |
( |
marker_pos_var |
( |
marker_shape_var |
( |
marker_shape_opt |
aesthetic values to map shape values (named vector to map shape values to each name).
If not |
marker_color_var |
marker color variable from marker data |
marker_color_opt |
aesthetic values to map color values (named vector to map color values to each name).
If not |
anno_txt_var |
character vector with subject-level variable names that are selected as annotation |
vref_line |
vertical reference lines |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
x_label |
the label of the x axis |
the teal::module()
object.
Ting Qi (qit3) [email protected]
# Example using stream (ADaM) dataset library(dplyr) library(nestcolor) ADSL <- osprey::rADSL %>% dplyr::mutate(TRTDURD = as.integer(TRTEDTM - TRTSDTM) + 1) %>% dplyr::filter(STRATA1 == "A" & ARMCD == "ARM A") ADRS <- osprey::rADRS ADRS <- ADRS %>% dplyr::filter(PARAMCD == "LSTASDI" & DCSREAS == "Death") %>% mutate(AVALC = DCSREAS, ADY = EOSDY) %>% base::rbind(ADRS %>% dplyr::filter(PARAMCD == "OVRINV" & AVALC != "NE")) %>% arrange(USUBJID) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL %>% dplyr::mutate(TRTDURD = as.integer(TRTEDTM - TRTSDTM) + 1) %>% dplyr::filter(STRATA1 == 'A' & ARMCD == 'ARM A')"), cdisc_dataset("ADRS", ADRS, code = "ADRS <- rADRS ADRS <- ADRS %>% dplyr::filter(PARAMCD == 'LSTASDI' & DCSREAS == 'Death') %>% mutate(AVALC = DCSREAS, ADY = EOSDY) %>% rbind(ADRS %>% dplyr::filter(PARAMCD == 'OVRINV' & AVALC != 'NE')) %>% arrange(USUBJID)" ), check = TRUE ), modules = modules( tm_g_swimlane( label = "Swimlane Plot", dataname = "ADRS", bar_var = teal.transform::choices_selected( selected = "TRTDURD", choices = c("TRTDURD", "EOSDY") ), bar_color_var = teal.transform::choices_selected( selected = "EOSSTT", choices = c("EOSSTT", "ARM", "ARMCD", "ACTARM", "ACTARMCD", "SEX") ), sort_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("USUBJID", "SITEID", "ACTARMCD", "TRTDURD") ), marker_pos_var = teal.transform::choices_selected( selected = "ADY", choices = c("ADY") ), marker_shape_var = teal.transform::choices_selected( selected = "AVALC", c("AVALC", "AVISIT") ), marker_shape_opt = c("CR" = 16, "PR" = 17, "SD" = 18, "PD" = 15, "Death" = 8), marker_color_var = teal.transform::choices_selected( selected = "AVALC", choices = c("AVALC", "AVISIT") ), marker_color_opt = c( "CR" = "green", "PR" = "blue", "SD" = "goldenrod", "PD" = "red", "Death" = "black" ), vref_line = c(30, 60), anno_txt_var = teal.transform::choices_selected( selected = c("ACTARM", "SEX"), choices = c( "ARM", "ARMCD", "ACTARM", "ACTARMCD", "AGEGR1", "SEX", "RACE", "COUNTRY", "DCSREAS", "DCSREASP" ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
# Example using stream (ADaM) dataset library(dplyr) library(nestcolor) ADSL <- osprey::rADSL %>% dplyr::mutate(TRTDURD = as.integer(TRTEDTM - TRTSDTM) + 1) %>% dplyr::filter(STRATA1 == "A" & ARMCD == "ARM A") ADRS <- osprey::rADRS ADRS <- ADRS %>% dplyr::filter(PARAMCD == "LSTASDI" & DCSREAS == "Death") %>% mutate(AVALC = DCSREAS, ADY = EOSDY) %>% base::rbind(ADRS %>% dplyr::filter(PARAMCD == "OVRINV" & AVALC != "NE")) %>% arrange(USUBJID) app <- init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL %>% dplyr::mutate(TRTDURD = as.integer(TRTEDTM - TRTSDTM) + 1) %>% dplyr::filter(STRATA1 == 'A' & ARMCD == 'ARM A')"), cdisc_dataset("ADRS", ADRS, code = "ADRS <- rADRS ADRS <- ADRS %>% dplyr::filter(PARAMCD == 'LSTASDI' & DCSREAS == 'Death') %>% mutate(AVALC = DCSREAS, ADY = EOSDY) %>% rbind(ADRS %>% dplyr::filter(PARAMCD == 'OVRINV' & AVALC != 'NE')) %>% arrange(USUBJID)" ), check = TRUE ), modules = modules( tm_g_swimlane( label = "Swimlane Plot", dataname = "ADRS", bar_var = teal.transform::choices_selected( selected = "TRTDURD", choices = c("TRTDURD", "EOSDY") ), bar_color_var = teal.transform::choices_selected( selected = "EOSSTT", choices = c("EOSSTT", "ARM", "ARMCD", "ACTARM", "ACTARMCD", "SEX") ), sort_var = teal.transform::choices_selected( selected = "ACTARMCD", choices = c("USUBJID", "SITEID", "ACTARMCD", "TRTDURD") ), marker_pos_var = teal.transform::choices_selected( selected = "ADY", choices = c("ADY") ), marker_shape_var = teal.transform::choices_selected( selected = "AVALC", c("AVALC", "AVISIT") ), marker_shape_opt = c("CR" = 16, "PR" = 17, "SD" = 18, "PD" = 15, "Death" = 8), marker_color_var = teal.transform::choices_selected( selected = "AVALC", choices = c("AVALC", "AVISIT") ), marker_color_opt = c( "CR" = "green", "PR" = "blue", "SD" = "goldenrod", "PD" = "red", "Death" = "black" ), vref_line = c(30, 60), anno_txt_var = teal.transform::choices_selected( selected = c("ACTARM", "SEX"), choices = c( "ARM", "ARMCD", "ACTARM", "ACTARMCD", "AGEGR1", "SEX", "RACE", "COUNTRY", "DCSREAS", "DCSREASP" ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This is teal module that generates a waterfall plot for ADaM
data
tm_g_waterfall( label, dataname_tr = "ADTR", dataname_rs = "ADRS", bar_paramcd, bar_var, bar_color_var, bar_color_opt = NULL, sort_var, add_label_var_sl, add_label_paramcd_rs, anno_txt_var_sl, anno_txt_paramcd_rs, facet_var, ytick_at = 20, href_line = NULL, gap_point_val = NULL, show_value = TRUE, plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
tm_g_waterfall( label, dataname_tr = "ADTR", dataname_rs = "ADRS", bar_paramcd, bar_var, bar_color_var, bar_color_opt = NULL, sort_var, add_label_var_sl, add_label_paramcd_rs, anno_txt_var_sl, anno_txt_paramcd_rs, facet_var, ytick_at = 20, href_line = NULL, gap_point_val = NULL, show_value = TRUE, plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname_tr |
tumor burden analysis data used in teal module to plot as bar height, needs to
be available in the list passed to the |
dataname_rs |
response analysis data used in teal module to label response parameters, needs to
be available in the list passed to the |
bar_paramcd |
( |
bar_var |
( |
bar_color_var |
( |
bar_color_opt |
aesthetic values to map color values (named vector to map color values to each name).
If not |
sort_var |
( |
add_label_var_sl |
( |
add_label_paramcd_rs |
( |
anno_txt_var_sl |
( |
anno_txt_paramcd_rs |
( |
facet_var |
( |
ytick_at |
bar height axis interval, default is |
href_line |
numeric vector to plot horizontal reference lines, default is |
gap_point_val |
singular numeric value for adding bar break when some bars are significantly higher
than others, default is |
show_value |
boolean of whether value of bar height is shown, default is |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
the teal::module()
object.
Ting Qi (qit3) [email protected]
houx14 [email protected]
library(nestcolor) ADSL <- osprey::rADSL ADRS <- osprey::rADRS ADTR <- osprey::rADTR ADSL$SEX <- factor(ADSL$SEX, levels = unique(ADSL$SEX)) app <- teal::init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- rADSL ADSL$SEX <- factor(ADSL$SEX, levels = unique(ADSL$SEX))" ), cdisc_dataset("ADRS", ADRS, code = "ADRS <- rADRS"), cdisc_dataset("ADTR", ADTR, code = " ADTR <- rADTR", c("STUDYID", "USUBJID", "PARAMCD", "AVISIT") ), check = TRUE ), modules = modules( tm_g_waterfall( label = "Waterfall", dataname_tr = "ADTR", dataname_rs = "ADRS", bar_paramcd = teal.transform::choices_selected(c("SLDINV"), "SLDINV"), bar_var = teal.transform::choices_selected(c("PCHG", "AVAL"), "PCHG"), bar_color_var = teal.transform::choices_selected(c("ARMCD", "SEX"), "ARMCD"), bar_color_opt = NULL, sort_var = teal.transform::choices_selected(c("ARMCD", "SEX"), NULL), add_label_var_sl = teal.transform::choices_selected(c("SEX", "EOSDY"), NULL), add_label_paramcd_rs = teal.transform::choices_selected(c("BESRSPI", "OBJRSPI"), NULL), anno_txt_var_sl = teal.transform::choices_selected(c("SEX", "ARMCD", "BMK1", "BMK2"), NULL), anno_txt_paramcd_rs = teal.transform::choices_selected(c("BESRSPI", "OBJRSPI"), NULL), facet_var = teal.transform::choices_selected(c("SEX", "ARMCD", "STRATA1", "STRATA2"), NULL), href_line = "-30, 20" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) ADSL <- osprey::rADSL ADRS <- osprey::rADRS ADTR <- osprey::rADTR ADSL$SEX <- factor(ADSL$SEX, levels = unique(ADSL$SEX)) app <- teal::init( data = cdisc_data( cdisc_dataset("ADSL", ADSL, code = "ADSL <- rADSL ADSL$SEX <- factor(ADSL$SEX, levels = unique(ADSL$SEX))" ), cdisc_dataset("ADRS", ADRS, code = "ADRS <- rADRS"), cdisc_dataset("ADTR", ADTR, code = " ADTR <- rADTR", c("STUDYID", "USUBJID", "PARAMCD", "AVISIT") ), check = TRUE ), modules = modules( tm_g_waterfall( label = "Waterfall", dataname_tr = "ADTR", dataname_rs = "ADRS", bar_paramcd = teal.transform::choices_selected(c("SLDINV"), "SLDINV"), bar_var = teal.transform::choices_selected(c("PCHG", "AVAL"), "PCHG"), bar_color_var = teal.transform::choices_selected(c("ARMCD", "SEX"), "ARMCD"), bar_color_opt = NULL, sort_var = teal.transform::choices_selected(c("ARMCD", "SEX"), NULL), add_label_var_sl = teal.transform::choices_selected(c("SEX", "EOSDY"), NULL), add_label_paramcd_rs = teal.transform::choices_selected(c("BESRSPI", "OBJRSPI"), NULL), anno_txt_var_sl = teal.transform::choices_selected(c("SEX", "ARMCD", "BMK1", "BMK2"), NULL), anno_txt_paramcd_rs = teal.transform::choices_selected(c("BESRSPI", "OBJRSPI"), NULL), facet_var = teal.transform::choices_selected(c("SEX", "ARMCD", "STRATA1", "STRATA2"), NULL), href_line = "-30, 20" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This is used in tm_g_ae_oview
and tm_g_events_term_id
.
ui_g_decorate( id, titles = "Titles", footnotes = "footnotes", fontsize = c(5, 4, 11) )
ui_g_decorate( id, titles = "Titles", footnotes = "footnotes", fontsize = c(5, 4, 11) )
id |
( |
titles |
( |
footnotes |
( |
fontsize |
( |