Title: | 'teal' Modules for Standard Clinical Outputs |
---|---|
Description: | Provides user-friendly tools for creating and customizing clinical trial reports. By leveraging the 'teal' framework, this package provides 'teal' modules to easily create an interactive panel that allows for seamless adjustments to data presentation, thereby streamlining the creation of detailed and accurate reports. |
Authors: | Joe Zhu [aut, cre], Jana Stoilova [aut], Davide Garolini [aut], Emily de la Rua [aut], Abinaya Yogasekaram [aut], Mahmoud Hallal [aut], Dawid Kaledkowski [aut], Rosemary Li [aut], Heng Wang [aut], Pawel Rucki [aut], Nikolas Burkoff [aut], Konrad Pagacz [aut], Vaakesan Sundrelingam [ctb], Francois Collin [ctb], Imanol Zubizarreta [ctb], F. Hoffmann-La Roche AG [cph, fnd] |
Maintainer: | Joe Zhu <[email protected]> |
License: | Apache License 2.0 |
Version: | 0.9.1.9031 |
Built: | 2024-11-08 17:16:35 UTC |
Source: | https://github.com/insightsengineering/teal.modules.clinical |
teal
Modules for Standard Clinical OutputsProvides teal modules for the standard clinical trials outputs. The teal modules add an encoding panel to interactively change the encodings within teal.
Maintainer: Joe Zhu [email protected]
Authors:
Jana Stoilova [email protected]
Davide Garolini [email protected]
Emily de la Rua [email protected]
Abinaya Yogasekaram [email protected]
Mahmoud Hallal [email protected]
Dawid Kaledkowski [email protected]
Rosemary Li [email protected]
Heng Wang [email protected]
Pawel Rucki [email protected]
Nikolas Burkoff
Konrad Pagacz
Other contributors:
Vaakesan Sundrelingam [contributor]
Francois Collin [contributor]
Imanol Zubizarreta [contributor]
F. Hoffmann-La Roche AG [copyright holder, funder]
Useful links:
https://insightsengineering.github.io/teal.modules.clinical/
https://github.com/insightsengineering/teal.modules.clinical/
Report bugs at https://github.com/insightsengineering/teal.modules.clinical/issues
Add a new expression to a list (of expressions).
add_expr(expr_ls, new_expr)
add_expr(expr_ls, new_expr)
expr_ls |
( |
new_expr |
( |
Offers a stricter control to add new expressions to an existing
list. The list of expressions can be later used to generate a pipeline,
for instance with pipe_expr
.
a list
of call
.
library(rtables) lyt <- list() lyt <- add_expr(lyt, substitute(basic_table())) lyt <- add_expr( lyt, substitute(split_cols_by(var = arm), env = list(armcd = "ARMCD")) ) lyt <- add_expr( lyt, substitute( test_proportion_diff( vars = "rsp", method = "cmh", variables = list(strata = "strata") ) ) ) lyt <- add_expr(lyt, quote(build_table(df = dta))) pipe_expr(lyt)
library(rtables) lyt <- list() lyt <- add_expr(lyt, substitute(basic_table())) lyt <- add_expr( lyt, substitute(split_cols_by(var = arm), env = list(armcd = "ARMCD")) ) lyt <- add_expr( lyt, substitute( test_proportion_diff( vars = "rsp", method = "cmh", variables = list(strata = "strata") ) ) ) lyt <- add_expr(lyt, quote(build_table(df = dta))) pipe_expr(lyt)
Generic to parse text into numeric vectors. This was initially designed for a robust interpretation of text input in teal modules.
as_num(str) ## Default S3 method: as_num(str) ## S3 method for class 'character' as_num(str) ## S3 method for class 'numeric' as_num(str) ## S3 method for class 'factor' as_num(str) ## S3 method for class 'logical' as_num(str)
as_num(str) ## Default S3 method: as_num(str) ## S3 method for class 'character' as_num(str) ## S3 method for class 'numeric' as_num(str) ## S3 method for class 'factor' as_num(str) ## S3 method for class 'logical' as_num(str)
str |
( |
The function is intended to extract any numeric from a character string, factor levels, boolean and return a vector of numeric.
As vector of numeric if directly parsed from numeric
or boolean.
A list of numeric if parsed from a character string, each character string
associated with an list item.
dta <- list( character = c("text10,20.5letter30.!", "!-.40$$-50e5[", NA), factor = factor(c("]+60e-6, 7.7%%8L", "%90sep.100\"1L", NA_character_)), numeric = c(1, -5e+2, NA), logical = c(TRUE, FALSE, NA) ) lapply(dta, as_num)
dta <- list( character = c("text10,20.5letter30.!", "!-.40$$-50e5[", NA), factor = factor(c("]+60e-6, 7.7%%8L", "%90sep.100\"1L", NA_character_)), numeric = c(1, -5e+2, NA), logical = c(TRUE, FALSE, NA) ) lapply(dta, as_num)
Groups several expressions in a single bracketed expression.
bracket_expr(exprs)
bracket_expr(exprs)
exprs |
( |
a {
object. See base::Paren()
for details.
adsl <- tmc_ex_adsl adrs <- tmc_ex_adrs expr1 <- substitute( expr = anl <- subset(df, PARAMCD == param), env = list(df = as.name("adrs"), param = "INVET") ) expr2 <- substitute(expr = anl$rsp_lab <- d_onco_rsp_label(anl$AVALC)) expr3 <- substitute( expr = { anl$is_rsp <- anl$rsp_lab %in% c("Complete Response (CR)", "Partial Response (PR)") } ) res <- bracket_expr(list(expr1, expr2, expr3)) eval(res) table(anl$rsp_lab, anl$is_rsp)
adsl <- tmc_ex_adsl adrs <- tmc_ex_adrs expr1 <- substitute( expr = anl <- subset(df, PARAMCD == param), env = list(df = as.name("adrs"), param = "INVET") ) expr2 <- substitute(expr = anl$rsp_lab <- d_onco_rsp_label(anl$AVALC)) expr3 <- substitute( expr = { anl$is_rsp <- anl$rsp_lab %in% c("Complete Response (CR)", "Partial Response (PR)") } ) res <- bracket_expr(list(expr1, expr2, expr3)) eval(res) table(anl$rsp_lab, anl$is_rsp)
e.g. combine with +
for ggplot
without introducing parentheses due to associativity
call_concatenate(args, bin_op = "+")
call_concatenate(args, bin_op = "+")
args |
arguments to concatenate with operator |
bin_op |
binary operator to concatenate it with |
a call
library(ggplot2) # What we want to achieve call("+", quote(f), quote(g)) call("+", quote(f), call("+", quote(g), quote(h))) # parentheses not wanted call("+", call("+", quote(f), quote(g)), quote(h)) # as expected without unnecessary parentheses Reduce(function(existing, new) call("+", existing, new), list(quote(f), quote(g), quote(h))) # how we do it call_concatenate(list(quote(f), quote(g), quote(h))) call_concatenate(list(quote(f))) call_concatenate(list()) call_concatenate( list(quote(ggplot(mtcars)), quote(geom_point(aes(wt, mpg)))) ) eval( call_concatenate( list(quote(ggplot(mtcars)), quote(geom_point(aes(wt, mpg)))) ) )
library(ggplot2) # What we want to achieve call("+", quote(f), quote(g)) call("+", quote(f), call("+", quote(g), quote(h))) # parentheses not wanted call("+", call("+", quote(f), quote(g)), quote(h)) # as expected without unnecessary parentheses Reduce(function(existing, new) call("+", existing, new), list(quote(f), quote(g), quote(h))) # how we do it call_concatenate(list(quote(f), quote(g), quote(h))) call_concatenate(list(quote(f))) call_concatenate(list()) call_concatenate( list(quote(ggplot(mtcars)), quote(geom_point(aes(wt, mpg)))) ) eval( call_concatenate( list(quote(ggplot(mtcars)), quote(geom_point(aes(wt, mpg)))) ) )
Cleaning categorical variable descriptions before presenting.
clean_description(x)
clean_description(x)
x |
( |
a string
clean_description("Level A (other text)") clean_description("A long string that should be shortened")
clean_description("Level A (other text)") clean_description("A long string that should be shortened")
Map value and level characters to values with with proper html tags, colors and icons.
color_lab_values( x, classes = c("HIGH", "NORMAL", "LOW"), colors = list(HIGH = "red", NORMAL = "grey", LOW = "blue"), default_color = "black", icons = list(HIGH = "glyphicon glyphicon-arrow-up", LOW = "glyphicon glyphicon-arrow-down") )
color_lab_values( x, classes = c("HIGH", "NORMAL", "LOW"), colors = list(HIGH = "red", NORMAL = "grey", LOW = "blue"), default_color = "black", icons = list(HIGH = "glyphicon glyphicon-arrow-up", LOW = "glyphicon glyphicon-arrow-down") )
x |
( |
classes |
( |
colors |
( |
default_color |
( |
icons |
( |
a character vector where each element is a formatted HTML tag corresponding to
a value in x
.
color_lab_values(c("LOW", "LOW", "HIGH", "NORMAL", "HIGH"))
color_lab_values(c("LOW", "LOW", "HIGH", "NORMAL", "HIGH"))
Get full label, useful for annotating plots
column_annotation_label(dataset, column, omit_raw_name = FALSE)
column_annotation_label(dataset, column, omit_raw_name = FALSE)
dataset |
( |
column |
( |
omit_raw_name |
( |
"Label [Column name]
" if label exists, otherwise "Column name".
data <- mtcars column_annotation_label(data, "cyl") attr(data[["cyl"]], "label") <- "Cylinder" column_annotation_label(data, "cyl") column_annotation_label(data, "cyl", omit_raw_name = TRUE) column_annotation_label(tmc_ex_adsl, "ACTARM")
data <- mtcars column_annotation_label(data, "cyl") attr(data[["cyl"]], "label") <- "Cylinder" column_annotation_label(data, "cyl") column_annotation_label(data, "cyl", omit_raw_name = TRUE) column_annotation_label(tmc_ex_adsl, "ACTARM")
Convert choices_selected to data_extract_spec with only filter_spec
cs_to_des_filter( cs, dataname, multiple = FALSE, include_vars = FALSE, label = "Filter by" )
cs_to_des_filter( cs, dataname, multiple = FALSE, include_vars = FALSE, label = "Filter by" )
cs |
( |
dataname |
( |
multiple |
( |
include_vars |
( |
label |
( |
(teal.transform::data_extract_spec()
)
Convert choices_selected to data_extract_spec with only select_spec
cs_to_des_select( cs, dataname, multiple = FALSE, ordered = FALSE, label = "Select" )
cs_to_des_select( cs, dataname, multiple = FALSE, ordered = FALSE, label = "Select" )
cs |
( |
dataname |
( |
multiple |
( |
ordered |
( |
label |
( |
(teal.transform::data_extract_spec()
)
Convert choices_selected to filter_spec
cs_to_filter_spec(cs, multiple = FALSE, label = "Filter by")
cs_to_filter_spec(cs, multiple = FALSE, label = "Filter by")
cs |
( |
multiple |
( |
label |
( |
(teal.transform::filter_spec()
)
Convert choices_selected to select_spec
cs_to_select_spec(cs, multiple = FALSE, ordered = FALSE, label = "Select")
cs_to_select_spec(cs, multiple = FALSE, ordered = FALSE, label = "Select")
cs |
( |
multiple |
( |
ordered |
( |
label |
( |
(select_spec
)
The default string used as a label for the "total" column. This value is used as the default
value for the total_label
argument throughout the teal.modules.clinical
package. If not specified
for each module by the user via the total_label
argument, or in the R environment options via
set_default_total_label()
, then "All Patients"
is used.
default_total_label() set_default_total_label(total_label)
default_total_label() set_default_total_label(total_label)
total_label |
( |
default_total_label
returns the current value if an R environment option has been set
for "tmc_default_total_label"
, or "All Patients"
otherwise.
set_default_total_label
has no return value.
default_total_label()
: Getter for default total column label.
set_default_total_label()
: Setter for default total column label. Sets the
option "tmc_default_total_label"
within the R environment.
# Default settings default_total_label() getOption("tmc_default_total_label") # Set custom value set_default_total_label("All Patients") # Settings after value has been set default_total_label() getOption("tmc_default_total_label")
# Default settings default_total_label() getOption("tmc_default_total_label") # Set custom value set_default_total_label("All Patients") # Settings after value has been set default_total_label() getOption("tmc_default_total_label")
CDISC
Data for ExamplesSimulated CDISC
Data for Examples
tmc_ex_adsl tmc_ex_adae tmc_ex_adaette tmc_ex_adcm tmc_ex_adeg tmc_ex_adex tmc_ex_adlb tmc_ex_admh tmc_ex_adqs tmc_ex_adrs tmc_ex_adtte tmc_ex_advs
tmc_ex_adsl tmc_ex_adae tmc_ex_adaette tmc_ex_adcm tmc_ex_adeg tmc_ex_adex tmc_ex_adlb tmc_ex_admh tmc_ex_adqs tmc_ex_adrs tmc_ex_adtte tmc_ex_advs
rds
(data.frame
)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 200 rows and 26 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 541 rows and 51 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1800 rows and 35 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 512 rows and 45 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 5200 rows and 48 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 200 rows and 37 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3000 rows and 58 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1077 rows and 33 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 7000 rows and 36 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1600 rows and 34 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1000 rows and 34 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 8400 rows and 34 columns.
tmc_ex_adsl
: ADSL
data
tmc_ex_adae
: ADAE
data
tmc_ex_adaette
: ADAETTE
data
tmc_ex_adcm
: ADCM
data
tmc_ex_adeg
: ADEG
data
tmc_ex_adex
: ADEX
data
tmc_ex_adlb
: ADLB
data
tmc_ex_admh
: ADMH
data
tmc_ex_adqs
: ADQS
data
tmc_ex_adrs
: ADRS
data
tmc_ex_adtte
: ADTTE
data
tmc_ex_advs
: ADVS
data
data_extract_ui
The data_extract_ui
is located under extended html id. We could not use ns("original id")
for reference, as it is extended with specific suffixes.
extract_input(varname, dataname, filter = FALSE)
extract_input(varname, dataname, filter = FALSE)
varname |
( |
dataname |
( |
filter |
( |
a string
extract_input("ARM", "ADSL")
extract_input("ARM", "ADSL")
get_var_labels(datasets, dataname, vars)
get_var_labels(datasets, dataname, vars)
datasets |
( |
dataname |
( |
vars |
( |
character
variable labels.
Deparse an expression into a string
.
h_concat_expr(expr)
h_concat_expr(expr)
expr |
( |
a string
.
expr <- quote({ library(rtables) basic_table() %>% split_cols_by(var = "ARMCD") %>% test_proportion_diff( vars = "rsp", method = "cmh", variables = list(strata = "strata") ) %>% build_table(df = dta) }) h_concat_expr(expr)
expr <- quote({ library(rtables) basic_table() %>% split_cols_by(var = "ARMCD") %>% test_proportion_diff( vars = "rsp", method = "cmh", variables = list(strata = "strata") ) %>% build_table(df = dta) }) h_concat_expr(expr)
teal.transform::choices_selected()
Whether object is of class teal.transform::choices_selected()
is.cs_or_des(x)
is.cs_or_des(x)
x |
object to be checked |
(logical
)
Concatenate expressions in a single pipeline-flavor expression.
pipe_expr(exprs, pipe_str = "%>%")
pipe_expr(exprs, pipe_str = "%>%")
exprs |
( |
pipe_str |
( |
a call
pipe_expr( list( expr1 = substitute(df), expr2 = substitute(head) ) )
pipe_expr( list( expr1 = substitute(df), expr2 = substitute(head) ) )
The function generate the standard expression for pre-processing of dataset
in teal module applications. This is especially of interest when the same
preprocessing steps needs to be applied similarly to several datasets
(e.g. ADSL
and ADRS
).
prepare_arm( dataname, arm_var, ref_arm, comp_arm, compare_arm = !is.null(ref_arm), ref_arm_val = paste(ref_arm, collapse = "/"), drop = TRUE )
prepare_arm( dataname, arm_var, ref_arm, comp_arm, compare_arm = !is.null(ref_arm), ref_arm_val = paste(ref_arm, collapse = "/"), drop = TRUE )
dataname |
( |
arm_var |
( |
ref_arm |
( |
comp_arm |
( |
compare_arm |
( |
ref_arm_val |
( |
drop |
( |
In teal.modules.clinical
, the user interface includes manipulation of
the study arms. Classically: the arm variable itself (e.g. ARM
, ACTARM
),
the reference arm (0 or more), the comparison arm (1 or more) and the
possibility to combine comparison arms.
Note that when no arms should be compared with each other, then the produced expression is reduced to optionally dropping non-represented levels of the arm.
When comparing arms, the pre-processing includes three steps:
Filtering of the dataset to retain only the arms of interest (reference and comparison).
Optional, if more than one arm is designated as reference they are combined into a single level.
The reference is explicitly reassigned and the non-represented levels of arm are dropped.
a call
prepare_arm( dataname = "adrs", arm_var = "ARMCD", ref_arm = "ARM A", comp_arm = c("ARM B", "ARM C") ) prepare_arm( dataname = "adsl", arm_var = "ARMCD", ref_arm = c("ARM B", "ARM C"), comp_arm = "ARM A" )
prepare_arm( dataname = "adrs", arm_var = "ARMCD", ref_arm = "ARM A", comp_arm = c("ARM B", "ARM C") ) prepare_arm( dataname = "adsl", arm_var = "ARMCD", ref_arm = c("ARM B", "ARM C"), comp_arm = "ARM A" )
This function generates the standard expression for pre-processing of dataset arm levels in and is used to apply the same steps in safety teal modules.
prepare_arm_levels(dataname, parentname, arm_var, drop_arm_levels = TRUE)
prepare_arm_levels(dataname, parentname, arm_var, drop_arm_levels = TRUE)
dataname |
( |
parentname |
( |
arm_var |
( |
drop_arm_levels |
( |
a {
object. See base::Paren()
for details.
prepare_arm_levels( dataname = "adae", parentname = "adsl", arm_var = "ARMCD", drop_arm_levels = TRUE ) prepare_arm_levels( dataname = "adae", parentname = "adsl", arm_var = "ARMCD", drop_arm_levels = FALSE )
prepare_arm_levels( dataname = "adae", parentname = "adsl", arm_var = "ARMCD", drop_arm_levels = TRUE ) prepare_arm_levels( dataname = "adae", parentname = "adsl", arm_var = "ARMCD", drop_arm_levels = FALSE )
choices_selected
objects with interactions into
their component variablesSplit choices_selected
objects with interactions into
their component variables
split_choices(x)
split_choices(x)
x |
( |
a choices_selected()
object.
uses the regex \\*|:
to perform the split.
split_choices(choices_selected(choices = c("x:y", "a*b"), selected = all_choices()))
split_choices(choices_selected(choices = c("x:y", "a*b"), selected = all_choices()))
Renders the expression for column split in rtables
depending on:
the expected or not arm comparison
the expected or not arm combination
split_col_expr(compare, combine, ref, arm_var)
split_col_expr(compare, combine, ref, arm_var)
compare |
( |
combine |
( |
ref |
( |
arm_var |
( |
a call
split_col_expr( compare = TRUE, combine = FALSE, ref = "ARM A", arm_var = "ARMCD" )
split_col_expr( compare = TRUE, combine = FALSE, ref = "ARM A", arm_var = "ARMCD" )
Split interaction terms into their component variables
split_interactions(x, by = "\\*|:")
split_interactions(x, by = "\\*|:")
x |
( |
by |
( |
a vector of strings where each element is a component
variable extracted from interaction term x
.
split_interactions("x:y") split_interactions("x*y")
split_interactions("x:y") split_interactions("x*y")
This module produces an analysis table using Generalized Estimating Equations (GEE).
tm_a_gee( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), aval_var, id_var, arm_var, visit_var, cov_var, arm_ref_comp = NULL, paramcd, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_a_gee( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), aval_var, id_var, arm_var, visit_var, cov_var, arm_ref_comp = NULL, paramcd, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
aval_var |
( |
id_var |
( |
arm_var |
( |
visit_var |
( |
cov_var |
( |
arm_ref_comp |
( |
paramcd |
( |
conf_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADQS <- tmc_ex_adqs %>% filter(ABLFL != "Y" & ABLFL2 != "Y") %>% mutate( AVISIT = as.factor(AVISIT), AVISITN = rank(AVISITN) %>% as.factor() %>% as.numeric() %>% as.factor(), AVALBIN = AVAL < 50 # Just as an example to get a binary endpoint. ) %>% droplevels() }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_a_gee( label = "GEE", dataname = "ADQS", aval_var = choices_selected("AVALBIN", fixed = TRUE), id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"), arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), visit_var = choices_selected(c("AVISIT", "AVISITN"), "AVISIT"), paramcd = choices_selected( choices = value_choices(data[["ADQS"]], "PARAMCD", "PARAM"), selected = "FKSI-FWB" ), cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADQS <- tmc_ex_adqs %>% filter(ABLFL != "Y" & ABLFL2 != "Y") %>% mutate( AVISIT = as.factor(AVISIT), AVISITN = rank(AVISITN) %>% as.factor() %>% as.numeric() %>% as.factor(), AVALBIN = AVAL < 50 # Just as an example to get a binary endpoint. ) %>% droplevels() }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_a_gee( label = "GEE", dataname = "ADQS", aval_var = choices_selected("AVALBIN", fixed = TRUE), id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"), arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), visit_var = choices_selected(c("AVISIT", "AVISITN"), "AVISIT"), paramcd = choices_selected( choices = value_choices(data[["ADQS"]], "PARAMCD", "PARAM"), selected = "FKSI-FWB" ), cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces analysis tables and plots for Mixed Model Repeated Measurements.
tm_a_mmrm( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), aval_var, id_var, arm_var, visit_var, cov_var, arm_ref_comp = NULL, paramcd, method = teal.transform::choices_selected(c("Satterthwaite", "Kenward-Roger", "Kenward-Roger-Linear"), "Satterthwaite", keep_order = TRUE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), plot_height = c(700L, 200L, 2000L), plot_width = NULL, total_label = default_total_label(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args(), ggplot2_args = teal.widgets::ggplot2_args() )
tm_a_mmrm( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), aval_var, id_var, arm_var, visit_var, cov_var, arm_ref_comp = NULL, paramcd, method = teal.transform::choices_selected(c("Satterthwaite", "Kenward-Roger", "Kenward-Roger-Linear"), "Satterthwaite", keep_order = TRUE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), plot_height = c(700L, 200L, 2000L), plot_width = NULL, total_label = default_total_label(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args(), ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
aval_var |
( |
id_var |
( |
arm_var |
( |
visit_var |
( |
cov_var |
( |
arm_ref_comp |
( |
paramcd |
( |
method |
( |
conf_level |
( |
plot_height |
( |
plot_width |
( |
total_label |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
ggplot2_args |
( |
a teal_module
object.
The ordering of the input data sets can lead to slightly different numerical results or
different convergence behavior. This is a known observation with the used package
lme4
. However, once convergence is achieved, the results are reliable up to
numerical precision.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) arm_ref_comp <- list( ARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADQS <- tmc_ex_adqs %>% filter(ABLFL != "Y" & ABLFL2 != "Y") %>% filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 3 DAY 22")) %>% mutate( AVISIT = as.factor(AVISIT), AVISITN = rank(AVISITN) %>% as.factor() %>% as.numeric() %>% as.factor() #' making consecutive numeric factor ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_a_mmrm( label = "MMRM", dataname = "ADQS", aval_var = choices_selected(c("AVAL", "CHG"), "AVAL"), id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"), arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), visit_var = choices_selected(c("AVISIT", "AVISITN"), "AVISIT"), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( choices = value_choices(data[["ADQS"]], "PARAMCD", "PARAM"), selected = "FKSI-FWB" ), cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) arm_ref_comp <- list( ARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADQS <- tmc_ex_adqs %>% filter(ABLFL != "Y" & ABLFL2 != "Y") %>% filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 3 DAY 22")) %>% mutate( AVISIT = as.factor(AVISIT), AVISITN = rank(AVISITN) %>% as.factor() %>% as.numeric() %>% as.factor() #' making consecutive numeric factor ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_a_mmrm( label = "MMRM", dataname = "ADQS", aval_var = choices_selected(c("AVAL", "CHG"), "AVAL"), id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"), arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), visit_var = choices_selected(c("AVISIT", "AVISITN"), "AVISIT"), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( choices = value_choices(data[["ADQS"]], "PARAMCD", "PARAM"), selected = "FKSI-FWB" ), cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a ggplot2::ggplot()
type bar chart and summary table of counts per category.
tm_g_barchart_simple( x = NULL, fill = NULL, x_facet = NULL, y_facet = NULL, label = "Count Barchart", plot_options = NULL, plot_height = c(600L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_barchart_simple( x = NULL, fill = NULL, x_facet = NULL, y_facet = NULL, label = "Count Barchart", plot_options = NULL, plot_height = c(600L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
x |
( |
fill |
( |
x_facet |
( |
y_facet |
( |
label |
( |
plot_options |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
Categories can be defined up to four levels deep and are defined through the x
, fill
,
x_facet
, and y_facet
parameters. Any parameters set to NULL
(default) are ignored.
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl %>% mutate(ITTFL = factor("Y") %>% with_label("Intent-To-Treat Population Flag")) ADAE <- tmc_ex_adae %>% filter(!((AETOXGR == 1) & (AESEV == "MILD") & (ARM == "A: Drug X"))) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_g_barchart_simple( label = "ADAE Analysis", x = data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = "ACTARM", multiple = FALSE ) ), fill = list( data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = "SEX", multiple = FALSE ) ), data_extract_spec( dataname = "ADAE", select = select_spec( choices = variable_choices(ADAE, c("AETOXGR", "AESEV", "AESER")), selected = NULL, multiple = FALSE ) ) ), x_facet = list( data_extract_spec( dataname = "ADAE", select = select_spec( choices = variable_choices(ADAE, c("AETOXGR", "AESEV", "AESER")), selected = "AETOXGR", multiple = FALSE ) ), data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = NULL, multiple = FALSE ) ) ), y_facet = list( data_extract_spec( dataname = "ADAE", select = select_spec( choices = variable_choices(ADAE, c("AETOXGR", "AESEV", "AESER")), selected = "AESEV", multiple = FALSE ) ), data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = NULL, multiple = FALSE ) ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl %>% mutate(ITTFL = factor("Y") %>% with_label("Intent-To-Treat Population Flag")) ADAE <- tmc_ex_adae %>% filter(!((AETOXGR == 1) & (AESEV == "MILD") & (ARM == "A: Drug X"))) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_g_barchart_simple( label = "ADAE Analysis", x = data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = "ACTARM", multiple = FALSE ) ), fill = list( data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = "SEX", multiple = FALSE ) ), data_extract_spec( dataname = "ADAE", select = select_spec( choices = variable_choices(ADAE, c("AETOXGR", "AESEV", "AESER")), selected = NULL, multiple = FALSE ) ) ), x_facet = list( data_extract_spec( dataname = "ADAE", select = select_spec( choices = variable_choices(ADAE, c("AETOXGR", "AESEV", "AESER")), selected = "AETOXGR", multiple = FALSE ) ), data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = NULL, multiple = FALSE ) ) ), y_facet = list( data_extract_spec( dataname = "ADAE", select = select_spec( choices = variable_choices(ADAE, c("AETOXGR", "AESEV", "AESER")), selected = "AESEV", multiple = FALSE ) ), data_extract_spec( dataname = "ADSL", select = select_spec( choices = variable_choices( ADSL, c( "ARM", "ACTARM", "SEX", "RACE", "ITTFL", "SAFFL", "STRATA2" ) ), selected = NULL, multiple = FALSE ) ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a ggplot2::ggplot()
type confidence interval plot consistent with the TLG Catalog template
CIG01
available here.
tm_g_ci( label, x_var, y_var, color, stat = c("mean", "median"), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_ci( label, x_var, y_var, color, stat = c("mean", "median"), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
x_var |
( |
y_var |
( |
color |
( |
stat |
( |
conf_level |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_g_ci( label = "Confidence Interval Plot", x_var = data_extract_spec( dataname = "ADSL", select = select_spec( choices = c("ARMCD", "BMRKR2"), selected = c("ARMCD"), multiple = FALSE, fixed = FALSE ) ), y_var = data_extract_spec( dataname = "ADLB", filter = list( filter_spec( vars = "PARAMCD", choices = levels(ADLB$PARAMCD), selected = levels(ADLB$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", choices = levels(ADLB$AVISIT), selected = levels(ADLB$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( label = "Analyzed Value", choices = c("AVAL", "CHG"), selected = "AVAL", multiple = FALSE, fixed = FALSE ) ), color = data_extract_spec( dataname = "ADSL", select = select_spec( label = "Color by variable", choices = c("SEX", "STRATA1", "STRATA2"), selected = c("STRATA1"), multiple = FALSE, fixed = FALSE ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_g_ci( label = "Confidence Interval Plot", x_var = data_extract_spec( dataname = "ADSL", select = select_spec( choices = c("ARMCD", "BMRKR2"), selected = c("ARMCD"), multiple = FALSE, fixed = FALSE ) ), y_var = data_extract_spec( dataname = "ADLB", filter = list( filter_spec( vars = "PARAMCD", choices = levels(ADLB$PARAMCD), selected = levels(ADLB$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", choices = levels(ADLB$AVISIT), selected = levels(ADLB$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( label = "Analyzed Value", choices = c("AVAL", "CHG"), selected = "AVAL", multiple = FALSE, fixed = FALSE ) ), color = data_extract_spec( dataname = "ADSL", select = select_spec( label = "Color by variable", choices = c("SEX", "STRATA1", "STRATA2"), selected = c("STRATA1"), multiple = FALSE, fixed = FALSE ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a grid-style forest plot for response data with ADaM structure.
tm_g_forest_rsp( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALC"), "AVALC", fixed = TRUE), subgroup_var, strata_var, stats = c("n_tot", "n", "n_rsp", "prop", "or", "ci"), riskdiff = NULL, fixed_symbol_size = TRUE, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), default_responses = c("CR", "PR", "Y", "Complete Response (CR)", "Partial Response (PR)"), plot_height = c(500L, 200L, 2000L), plot_width = c(1500L, 800L, 3000L), rel_width_forest = c(25L, 0L, 100L), font_size = c(15L, 1L, 30L), pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_forest_rsp( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALC"), "AVALC", fixed = TRUE), subgroup_var, strata_var, stats = c("n_tot", "n", "n_rsp", "prop", "or", "ci"), riskdiff = NULL, fixed_symbol_size = TRUE, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), default_responses = c("CR", "PR", "Y", "Complete Response (CR)", "Partial Response (PR)"), plot_height = c(500L, 200L, 2000L), plot_width = c(1500L, 800L, 3000L), rel_width_forest = c(25L, 0L, 100L), font_size = c(15L, 1L, 30L), pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
paramcd |
( |
aval_var |
( |
subgroup_var |
( |
strata_var |
( |
stats |
(
|
riskdiff |
( |
fixed_symbol_size |
( |
conf_level |
( |
default_responses |
( |
plot_height |
( |
plot_width |
( |
rel_width_forest |
( |
font_size |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( For more details, see the vignette: |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADRS <- tmc_ex_adrs %>% mutate(AVALC = d_onco_rsp_label(AVALC) %>% with_label("Character Result/Finding")) %>% filter(PARAMCD != "OVRINV" | AVISIT == "FOLLOW UP") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADRS <- data[["ADRS"]] arm_ref_comp <- list( ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ), ARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) app <- init( data = data, modules = modules( tm_g_forest_rsp( label = "Forest Response", dataname = "ADRS", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD")), "ARMCD" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADRS, "PARAMCD", "PARAM"), "INVET" ), subgroup_var = choices_selected( variable_choices(ADSL, names(ADSL)), c("BMRKR2", "SEX") ), strata_var = choices_selected( variable_choices(ADSL, c("STRATA1", "STRATA2")), "STRATA2" ), plot_height = c(600L, 200L, 2000L), default_responses = list( BESRSPI = list( rsp = c("Stable Disease (SD)", "Not Evaluable (NE)"), levels = c( "Complete Response (CR)", "Partial Response (PR)", "Stable Disease (SD)", "Progressive Disease (PD)", "Not Evaluable (NE)" ) ), INVET = list( rsp = c("Complete Response (CR)", "Partial Response (PR)"), levels = c( "Complete Response (CR)", "Not Evaluable (NE)", "Partial Response (PR)", "Progressive Disease (PD)", "Stable Disease (SD)" ) ), OVRINV = list( rsp = c("Progressive Disease (PD)", "Stable Disease (SD)"), levels = c("Progressive Disease (PD)", "Stable Disease (SD)", "Not Evaluable (NE)") ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADRS <- tmc_ex_adrs %>% mutate(AVALC = d_onco_rsp_label(AVALC) %>% with_label("Character Result/Finding")) %>% filter(PARAMCD != "OVRINV" | AVISIT == "FOLLOW UP") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADRS <- data[["ADRS"]] arm_ref_comp <- list( ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ), ARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) app <- init( data = data, modules = modules( tm_g_forest_rsp( label = "Forest Response", dataname = "ADRS", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD")), "ARMCD" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADRS, "PARAMCD", "PARAM"), "INVET" ), subgroup_var = choices_selected( variable_choices(ADSL, names(ADSL)), c("BMRKR2", "SEX") ), strata_var = choices_selected( variable_choices(ADSL, c("STRATA1", "STRATA2")), "STRATA2" ), plot_height = c(600L, 200L, 2000L), default_responses = list( BESRSPI = list( rsp = c("Stable Disease (SD)", "Not Evaluable (NE)"), levels = c( "Complete Response (CR)", "Partial Response (PR)", "Stable Disease (SD)", "Progressive Disease (PD)", "Not Evaluable (NE)" ) ), INVET = list( rsp = c("Complete Response (CR)", "Partial Response (PR)"), levels = c( "Complete Response (CR)", "Not Evaluable (NE)", "Partial Response (PR)", "Progressive Disease (PD)", "Stable Disease (SD)" ) ), OVRINV = list( rsp = c("Progressive Disease (PD)", "Stable Disease (SD)"), levels = c("Progressive Disease (PD)", "Stable Disease (SD)", "Not Evaluable (NE)") ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a grid-style forest plot for time-to-event data with ADaM structure.
tm_g_forest_tte( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, subgroup_var, paramcd, strata_var, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), stats = c("n_tot_events", "n_events", "median", "hr", "ci"), riskdiff = NULL, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), time_unit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), fixed_symbol_size = TRUE, plot_height = c(500L, 200L, 2000L), plot_width = c(1500L, 800L, 3000L), rel_width_forest = c(25L, 0L, 100L), font_size = c(15L, 1L, 30L), pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_forest_tte( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, subgroup_var, paramcd, strata_var, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), stats = c("n_tot_events", "n_events", "median", "hr", "ci"), riskdiff = NULL, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), time_unit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), fixed_symbol_size = TRUE, plot_height = c(500L, 200L, 2000L), plot_width = c(1500L, 800L, 3000L), rel_width_forest = c(25L, 0L, 100L), font_size = c(15L, 1L, 30L), pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
subgroup_var |
( |
paramcd |
( |
strata_var |
( |
aval_var |
( |
cnsr_var |
( |
stats |
(
|
riskdiff |
( |
conf_level |
( |
time_unit_var |
( |
fixed_symbol_size |
( |
plot_height |
( |
plot_width |
( |
rel_width_forest |
( |
font_size |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte ADSL$RACE <- droplevels(ADSL$RACE) %>% with_label("Race") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] arm_ref_comp <- list( ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ), ARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) app <- init( data = data, modules = modules( tm_g_forest_tte( label = "Forest Survival", dataname = "ADTTE", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD")), "ARMCD" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), subgroup_var = choices_selected( variable_choices(ADSL, names(ADSL)), c("BMRKR2", "SEX") ), strata_var = choices_selected( variable_choices(ADSL, c("STRATA1", "STRATA2")), "STRATA2" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte ADSL$RACE <- droplevels(ADSL$RACE) %>% with_label("Race") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] arm_ref_comp <- list( ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ), ARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) app <- init( data = data, modules = modules( tm_g_forest_tte( label = "Forest Survival", dataname = "ADTTE", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD")), "ARMCD" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), subgroup_var = choices_selected( variable_choices(ADSL, names(ADSL)), c("BMRKR2", "SEX") ), strata_var = choices_selected( variable_choices(ADSL, c("STRATA1", "STRATA2")), "STRATA2" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces ggplot2::ggplot()
type individual patient plots that display trends in parameter
values over time for each patient, using data with ADaM structure.
tm_g_ipp( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, paramcd, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "USUBJID"), "USUBJID", fixed = TRUE), visit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVISIT"), "AVISIT", fixed = TRUE), aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), base_var = lifecycle::deprecated(), baseline_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "BASE"), "BASE", fixed = TRUE), add_baseline_hline = FALSE, separate_by_obs = FALSE, suppress_legend = FALSE, add_avalu = TRUE, plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_ipp( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, paramcd, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "USUBJID"), "USUBJID", fixed = TRUE), visit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVISIT"), "AVISIT", fixed = TRUE), aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), base_var = lifecycle::deprecated(), baseline_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "BASE"), "BASE", fixed = TRUE), add_baseline_hline = FALSE, separate_by_obs = FALSE, suppress_legend = FALSE, add_avalu = TRUE, plot_height = c(1200L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
paramcd |
( |
id_var |
( |
visit_var |
( |
aval_var |
( |
avalu_var |
( |
base_var |
|
baseline_var |
( |
add_baseline_hline |
( |
separate_by_obs |
( |
suppress_legend |
( |
add_avalu |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( For more details, see the vignette: |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl %>% slice(1:20) %>% df_explicit_na() ADLB <- tmc_ex_adlb %>% filter(USUBJID %in% ADSL$USUBJID) %>% df_explicit_na() %>% filter(AVISIT != "SCREENING") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_g_ipp( label = "Individual Patient Plot", dataname = "ADLB", arm_var = choices_selected( value_choices(ADLB, "ARMCD"), "ARM A" ), paramcd = choices_selected( value_choices(ADLB, "PARAMCD"), "ALT" ), aval_var = choices_selected( variable_choices(ADLB, c("AVAL", "CHG")), "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 ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl %>% slice(1:20) %>% df_explicit_na() ADLB <- tmc_ex_adlb %>% filter(USUBJID %in% ADSL$USUBJID) %>% df_explicit_na() %>% filter(AVISIT != "SCREENING") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_g_ipp( label = "Individual Patient Plot", dataname = "ADLB", arm_var = choices_selected( value_choices(ADLB, "ARMCD"), "ARM A" ), paramcd = choices_selected( value_choices(ADLB, "PARAMCD"), "ALT" ), aval_var = choices_selected( variable_choices(ADLB, c("AVAL", "CHG")), "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 ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a ggplot
-style Kaplan-Meier plot for data with ADaM structure.
tm_g_km( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, strata_var, facet_var, time_unit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), font_size = c(11L, 1L, 30), control_annot_surv_med = control_surv_med_annot(), control_annot_coxph = control_coxph_annot(x = 0.27, y = 0.35, w = 0.3), legend_pos = c(0.9, 0.5), rel_height_plot = c(80L, 0L, 100L), plot_height = c(800L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
tm_g_km( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, strata_var, facet_var, time_unit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), font_size = c(11L, 1L, 30), control_annot_surv_med = control_surv_med_annot(), control_annot_coxph = control_coxph_annot(x = 0.27, y = 0.35, w = 0.3), legend_pos = c(0.9, 0.5), rel_height_plot = c(80L, 0L, 100L), plot_height = c(800L, 400L, 5000L), plot_width = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
paramcd |
( |
strata_var |
( |
facet_var |
( |
time_unit_var |
( |
aval_var |
( |
cnsr_var |
( |
conf_level |
( |
font_size |
( |
control_annot_surv_med |
( |
control_annot_coxph |
( |
legend_pos |
( |
rel_height_plot |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) app <- init( data = data, modules = modules( tm_g_km( label = "Kaplan-Meier Plot", dataname = "ADTTE", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")), "ARM" ), paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), arm_ref_comp = arm_ref_comp, strata_var = choices_selected( variable_choices(ADSL, c("SEX", "BMRKR2")), "SEX" ), facet_var = choices_selected( variable_choices(ADSL, c("SEX", "BMRKR2")), NULL ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) app <- init( data = data, modules = modules( tm_g_km( label = "Kaplan-Meier Plot", dataname = "ADTTE", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")), "ARM" ), paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), arm_ref_comp = arm_ref_comp, strata_var = choices_selected( variable_choices(ADSL, c("SEX", "BMRKR2")), "SEX" ), facet_var = choices_selected( variable_choices(ADSL, c("SEX", "BMRKR2")), NULL ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a ggplot2::ggplot()
type line plot, with optional summary table, for standard ADaM data.
tm_g_lineplot( label, dataname, parentname = ifelse(inherits(strata, "data_extract_spec"), teal.transform::datanames_input(strata), "ADSL"), strata = teal.transform::choices_selected(teal.transform::variable_choices(parentname, c("ARM", "ARMCD", "ACTARMCD")), "ARM"), x = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVISIT"), "AVISIT", fixed = TRUE), y = teal.transform::choices_selected(teal.transform::variable_choices(dataname, c("AVAL", "BASE", "CHG", "PCHG")), "AVAL"), y_unit = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), paramcd = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "PARAMCD"), "PARAMCD", fixed = TRUE), param = teal.transform::choices_selected(teal.transform::value_choices(dataname, "PARAMCD", "PARAM"), "ALT"), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), interval = "mean_ci", mid = "mean", whiskers = c("mean_ci_lwr", "mean_ci_upr"), table = c("n", "mean_sd", "median", "range"), mid_type = "pl", mid_point_size = c(2, 1, 5), table_font_size = c(4, 2, 6), plot_height = c(1000L, 200L, 4000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_lineplot( label, dataname, parentname = ifelse(inherits(strata, "data_extract_spec"), teal.transform::datanames_input(strata), "ADSL"), strata = teal.transform::choices_selected(teal.transform::variable_choices(parentname, c("ARM", "ARMCD", "ACTARMCD")), "ARM"), x = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVISIT"), "AVISIT", fixed = TRUE), y = teal.transform::choices_selected(teal.transform::variable_choices(dataname, c("AVAL", "BASE", "CHG", "PCHG")), "AVAL"), y_unit = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), paramcd = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "PARAMCD"), "PARAMCD", fixed = TRUE), param = teal.transform::choices_selected(teal.transform::value_choices(dataname, "PARAMCD", "PARAM"), "ALT"), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), interval = "mean_ci", mid = "mean", whiskers = c("mean_ci_lwr", "mean_ci_upr"), table = c("n", "mean_sd", "median", "range"), mid_type = "pl", mid_point_size = c(2, 1, 5), table_font_size = c(4, 2, 6), plot_height = c(1000L, 200L, 4000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
strata |
( |
x |
( |
y |
( |
y_unit |
( |
paramcd |
( |
param |
( |
conf_level |
( |
interval |
( |
mid |
( |
whiskers |
( |
table |
( |
mid_type |
( |
mid_point_size |
( |
table_font_size |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( For more details, see the vignette: |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor) library(dplyr) library(forcats) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb %>% mutate(AVISIT == fct_reorder(AVISIT, AVISITN, min)) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_g_lineplot( label = "Line Plot", dataname = "ADLB", strata = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")), "ARM" ), y = choices_selected( variable_choices(ADLB, c("AVAL", "BASE", "CHG", "PCHG")), "AVAL" ), param = choices_selected( value_choices(ADLB, "PARAMCD", "PARAM"), "ALT" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) library(forcats) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb %>% mutate(AVISIT == fct_reorder(AVISIT, AVISITN, min)) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_g_lineplot( label = "Line Plot", dataname = "ADLB", strata = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")), "ARM" ), y = choices_selected( variable_choices(ADLB, c("AVAL", "BASE", "CHG", "PCHG")), "AVAL" ), param = choices_selected( value_choices(ADLB, "PARAMCD", "PARAM"), "ALT" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces an adverse events table and ggplot2::ggplot()
type plot using ADaM datasets.
tm_g_pp_adverse_events( label, dataname = "ADAE", parentname = "ADSL", patient_col = "USUBJID", aeterm = NULL, tox_grade = NULL, causality = NULL, outcome = NULL, action = NULL, time = NULL, decod = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_pp_adverse_events( label, dataname = "ADAE", parentname = "ADSL", patient_col = "USUBJID", aeterm = NULL, tox_grade = NULL, causality = NULL, outcome = NULL, action = NULL, time = NULL, decod = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
patient_col |
( |
aeterm |
( |
tox_grade |
( |
causality |
( |
outcome |
( |
action |
( |
time |
( |
decod |
( |
font_size |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
a teal_module
object.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADAE <- tmc_ex_adae ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADAE$USUBJID) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_g_pp_adverse_events( label = "Adverse Events", dataname = "ADAE", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), aeterm = choices_selected( choices = variable_choices(ADAE, "AETERM"), selected = "AETERM" ), tox_grade = choices_selected( choices = variable_choices(ADAE, "AETOXGR"), selected = "AETOXGR" ), causality = choices_selected( choices = variable_choices(ADAE, "AEREL"), selected = "AEREL" ), outcome = choices_selected( choices = variable_choices(ADAE, "AEOUT"), selected = "AEOUT" ), action = choices_selected( choices = variable_choices(ADAE, "AEACN"), selected = "AEACN" ), time = choices_selected( choices = variable_choices(ADAE, "ASTDY"), selected = "ASTDY" ), decod = NULL ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADAE <- tmc_ex_adae ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADAE$USUBJID) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_g_pp_adverse_events( label = "Adverse Events", dataname = "ADAE", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), aeterm = choices_selected( choices = variable_choices(ADAE, "AETERM"), selected = "AETERM" ), tox_grade = choices_selected( choices = variable_choices(ADAE, "AETOXGR"), selected = "AETOXGR" ), causality = choices_selected( choices = variable_choices(ADAE, "AEREL"), selected = "AEREL" ), outcome = choices_selected( choices = variable_choices(ADAE, "AEOUT"), selected = "AEOUT" ), action = choices_selected( choices = variable_choices(ADAE, "AEACN"), selected = "AEACN" ), time = choices_selected( choices = variable_choices(ADAE, "ASTDY"), selected = "ASTDY" ), decod = NULL ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile timeline ggplot2::ggplot()
type plot using ADaM datasets.
tm_g_pp_patient_timeline( label, dataname_adcm = "ADCM", dataname_adae = "ADAE", parentname = "ADSL", patient_col = "USUBJID", aeterm = NULL, cmdecod = NULL, aetime_start = NULL, aetime_end = NULL, dstime_start = NULL, dstime_end = NULL, aerelday_start = NULL, aerelday_end = NULL, dsrelday_start = NULL, dsrelday_end = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_pp_patient_timeline( label, dataname_adcm = "ADCM", dataname_adae = "ADAE", parentname = "ADSL", patient_col = "USUBJID", aeterm = NULL, cmdecod = NULL, aetime_start = NULL, aetime_end = NULL, dstime_start = NULL, dstime_end = NULL, aerelday_start = NULL, aerelday_end = NULL, dsrelday_start = NULL, dsrelday_end = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname_adcm |
( |
dataname_adae |
( |
parentname |
( |
patient_col |
( |
aeterm |
( |
cmdecod |
( |
aetime_start |
( |
aetime_end |
( |
dstime_start |
( |
dstime_end |
( |
aerelday_start |
( |
aerelday_end |
( |
dsrelday_start |
( |
dsrelday_end |
( |
font_size |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
a teal_module
object.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADAE <- tmc_ex_adae ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADAE$USUBJID) ADCM <- tmc_ex_adcm %>% mutate( CMSTDY = case_when( CMCAT == "medcl B" ~ 20, CMCAT == "medcl C" ~ 150, TRUE ~ 1 ) %>% with_label("Study Day of Start of Medication"), CMENDY = case_when( CMCAT == "medcl B" ~ 700, CMCAT == "medcl C" ~ 1000, TRUE ~ 500 ) %>% with_label("Study Day of End of Medication"), CMASTDTM = ASTDTM, CMAENDTM = AENDTM ) }) join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADAE", "ADCM")] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys join_keys(data)["ADAE", "ADCM"] <- c("STUDYID", "USUBJID") app <- init( data = data, modules = modules( tm_g_pp_patient_timeline( label = "Patient Timeline", dataname_adae = "ADAE", dataname_adcm = "ADCM", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), cmdecod = choices_selected( choices = variable_choices(data[["ADCM"]], "CMDECOD"), selected = "CMDECOD", ), aeterm = choices_selected( choices = variable_choices(data[["ADAE"]], "AETERM"), selected = c("AETERM") ), aetime_start = choices_selected( choices = variable_choices(data[["ADAE"]], "ASTDTM"), selected = c("ASTDTM") ), aetime_end = choices_selected( choices = variable_choices(data[["ADAE"]], "AENDTM"), selected = c("AENDTM") ), dstime_start = choices_selected( choices = variable_choices(data[["ADCM"]], "CMASTDTM"), selected = c("CMASTDTM") ), dstime_end = choices_selected( choices = variable_choices(data[["ADCM"]], "CMAENDTM"), selected = c("CMAENDTM") ), aerelday_start = choices_selected( choices = variable_choices(data[["ADAE"]], "ASTDY"), selected = c("ASTDY") ), aerelday_end = choices_selected( choices = variable_choices(data[["ADAE"]], "AENDY"), selected = c("AENDY") ), dsrelday_start = choices_selected( choices = variable_choices(data[["ADCM"]], "ASTDY"), selected = c("ASTDY") ), dsrelday_end = choices_selected( choices = variable_choices(data[["ADCM"]], "AENDY"), selected = c("AENDY") ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADAE <- tmc_ex_adae ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADAE$USUBJID) ADCM <- tmc_ex_adcm %>% mutate( CMSTDY = case_when( CMCAT == "medcl B" ~ 20, CMCAT == "medcl C" ~ 150, TRUE ~ 1 ) %>% with_label("Study Day of Start of Medication"), CMENDY = case_when( CMCAT == "medcl B" ~ 700, CMCAT == "medcl C" ~ 1000, TRUE ~ 500 ) %>% with_label("Study Day of End of Medication"), CMASTDTM = ASTDTM, CMAENDTM = AENDTM ) }) join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADAE", "ADCM")] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys join_keys(data)["ADAE", "ADCM"] <- c("STUDYID", "USUBJID") app <- init( data = data, modules = modules( tm_g_pp_patient_timeline( label = "Patient Timeline", dataname_adae = "ADAE", dataname_adcm = "ADCM", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), cmdecod = choices_selected( choices = variable_choices(data[["ADCM"]], "CMDECOD"), selected = "CMDECOD", ), aeterm = choices_selected( choices = variable_choices(data[["ADAE"]], "AETERM"), selected = c("AETERM") ), aetime_start = choices_selected( choices = variable_choices(data[["ADAE"]], "ASTDTM"), selected = c("ASTDTM") ), aetime_end = choices_selected( choices = variable_choices(data[["ADAE"]], "AENDTM"), selected = c("AENDTM") ), dstime_start = choices_selected( choices = variable_choices(data[["ADCM"]], "CMASTDTM"), selected = c("CMASTDTM") ), dstime_end = choices_selected( choices = variable_choices(data[["ADCM"]], "CMAENDTM"), selected = c("CMAENDTM") ), aerelday_start = choices_selected( choices = variable_choices(data[["ADAE"]], "ASTDY"), selected = c("ASTDY") ), aerelday_end = choices_selected( choices = variable_choices(data[["ADAE"]], "AENDY"), selected = c("AENDY") ), dsrelday_start = choices_selected( choices = variable_choices(data[["ADCM"]], "ASTDY"), selected = c("ASTDY") ), dsrelday_end = choices_selected( choices = variable_choices(data[["ADCM"]], "AENDY"), selected = c("AENDY") ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile therapy table and ggplot2::ggplot()
type plot using ADaM datasets.
tm_g_pp_therapy( label, dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", atirel = NULL, cmdecod = NULL, cmindc = NULL, cmdose = NULL, cmtrt = NULL, cmdosu = NULL, cmroute = NULL, cmdosfrq = NULL, cmstdy = NULL, cmendy = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_pp_therapy( label, dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", atirel = NULL, cmdecod = NULL, cmindc = NULL, cmdose = NULL, cmtrt = NULL, cmdosu = NULL, cmroute = NULL, cmdosfrq = NULL, cmstdy = NULL, cmendy = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
patient_col |
( |
atirel |
( |
cmdecod |
( |
cmindc |
( |
cmdose |
( |
cmtrt |
( |
cmdosu |
( |
cmroute |
( |
cmdosfrq |
( |
cmstdy |
( |
cmendy |
( |
font_size |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
a teal_module
object.
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADCM <- tmc_ex_adcm ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADCM$USUBJID) ADCM$CMASTDTM <- ADCM$ASTDTM ADCM$CMAENDTM <- ADCM$AENDTM }) join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADCM")] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] app <- init( data = data, modules = modules( tm_g_pp_therapy( label = "Therapy", dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), atirel = choices_selected( choices = variable_choices(ADCM, "ATIREL"), selected = c("ATIREL") ), cmdecod = choices_selected( choices = variable_choices(ADCM, "CMDECOD"), selected = "CMDECOD" ), cmindc = choices_selected( choices = variable_choices(ADCM, "CMINDC"), selected = "CMINDC" ), cmdose = choices_selected( choices = variable_choices(ADCM, "CMDOSE"), selected = "CMDOSE" ), cmtrt = choices_selected( choices = variable_choices(ADCM, "CMTRT"), selected = "CMTRT" ), cmdosu = choices_selected( choices = variable_choices(ADCM, "CMDOSU"), selected = c("CMDOSU") ), cmroute = choices_selected( choices = variable_choices(ADCM, "CMROUTE"), selected = "CMROUTE" ), cmdosfrq = choices_selected( choices = variable_choices(ADCM, "CMDOSFRQ"), selected = "CMDOSFRQ" ), cmstdy = choices_selected( choices = variable_choices(ADCM, "ASTDY"), selected = "ASTDY" ), cmendy = choices_selected( choices = variable_choices(ADCM, "AENDY"), selected = "AENDY" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) library(dplyr) data <- teal_data() data <- within(data, { ADCM <- tmc_ex_adcm ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADCM$USUBJID) ADCM$CMASTDTM <- ADCM$ASTDTM ADCM$CMAENDTM <- ADCM$AENDTM }) join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADCM")] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] app <- init( data = data, modules = modules( tm_g_pp_therapy( label = "Therapy", dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), atirel = choices_selected( choices = variable_choices(ADCM, "ATIREL"), selected = c("ATIREL") ), cmdecod = choices_selected( choices = variable_choices(ADCM, "CMDECOD"), selected = "CMDECOD" ), cmindc = choices_selected( choices = variable_choices(ADCM, "CMINDC"), selected = "CMINDC" ), cmdose = choices_selected( choices = variable_choices(ADCM, "CMDOSE"), selected = "CMDOSE" ), cmtrt = choices_selected( choices = variable_choices(ADCM, "CMTRT"), selected = "CMTRT" ), cmdosu = choices_selected( choices = variable_choices(ADCM, "CMDOSU"), selected = c("CMDOSU") ), cmroute = choices_selected( choices = variable_choices(ADCM, "CMROUTE"), selected = "CMROUTE" ), cmdosfrq = choices_selected( choices = variable_choices(ADCM, "CMDOSFRQ"), selected = "CMDOSFRQ" ), cmstdy = choices_selected( choices = variable_choices(ADCM, "ASTDY"), selected = "ASTDY" ), cmendy = choices_selected( choices = variable_choices(ADCM, "AENDY"), selected = "AENDY" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile vitals ggplot2::ggplot()
type plot using ADaM datasets.
tm_g_pp_vitals( label, dataname = "ADVS", parentname = "ADSL", patient_col = "USUBJID", paramcd = NULL, aval = lifecycle::deprecated(), aval_var = NULL, xaxis = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
tm_g_pp_vitals( label, dataname = "ADVS", parentname = "ADSL", patient_col = "USUBJID", paramcd = NULL, aval = lifecycle::deprecated(), aval_var = NULL, xaxis = NULL, font_size = c(12L, 12L, 25L), plot_height = c(700L, 200L, 2000L), plot_width = NULL, pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args() )
label |
( |
dataname |
( |
parentname |
( |
patient_col |
( |
paramcd |
( |
aval |
|
aval_var |
( |
xaxis |
( |
font_size |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( |
This plot supports horizontal lines for the following 6 PARAMCD
levels when they are present in dataname
:
"SYSBP"
, "DIABP"
, "TEMP"
, "RESP"
, "OXYSAT"
.
a teal_module
object.
library(nestcolor) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADVS <- tmc_ex_advs }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADVS <- data[["ADVS"]] app <- init( data = data, modules = modules( tm_g_pp_vitals( label = "Vitals", dataname = "ADVS", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), paramcd = choices_selected( choices = variable_choices(ADVS, "PARAMCD"), selected = "PARAMCD" ), xaxis = choices_selected( choices = variable_choices(ADVS, "ADY"), selected = "ADY" ), aval_var = choices_selected( choices = variable_choices(ADVS, "AVAL"), selected = "AVAL" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(nestcolor) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADVS <- tmc_ex_advs }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADVS <- data[["ADVS"]] app <- init( data = data, modules = modules( tm_g_pp_vitals( label = "Vitals", dataname = "ADVS", parentname = "ADSL", patient_col = "USUBJID", plot_height = c(600L, 200L, 2000L), paramcd = choices_selected( choices = variable_choices(ADVS, "PARAMCD"), selected = "PARAMCD" ), xaxis = choices_selected( choices = variable_choices(ADVS, "ADY"), selected = "ADY" ), aval_var = choices_selected( choices = variable_choices(ADVS, "AVAL"), selected = "AVAL" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table to summarize abnormality.
tm_t_abnormality( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, by_vars, grade, abnormal = list(low = c("LOW", "LOW LOW"), high = c("HIGH", "HIGH HIGH")), id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), baseline_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "BNRIND"), selected = "BNRIND", fixed = TRUE), treatment_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "ONTRTFL"), selected = "ONTRTFL", fixed = TRUE), treatment_flag = teal.transform::choices_selected("Y"), add_total = TRUE, total_label = default_total_label(), exclude_base_abn = FALSE, drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, na_level = default_na_str(), basic_table_args = teal.widgets::basic_table_args() )
tm_t_abnormality( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, by_vars, grade, abnormal = list(low = c("LOW", "LOW LOW"), high = c("HIGH", "HIGH HIGH")), id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), baseline_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "BNRIND"), selected = "BNRIND", fixed = TRUE), treatment_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "ONTRTFL"), selected = "ONTRTFL", fixed = TRUE), treatment_flag = teal.transform::choices_selected("Y"), add_total = TRUE, total_label = default_total_label(), exclude_base_abn = FALSE, drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, na_level = default_na_str(), basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
by_vars |
( |
grade |
( |
abnormal |
( |
id_var |
( |
baseline_var |
( |
treatment_flag_var |
( |
treatment_flag |
( |
add_total |
( |
total_label |
( |
exclude_base_abn |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
na_level |
( |
basic_table_args |
( |
a teal_module
object.
Patients with the same abnormality at baseline as on the treatment visit can be
excluded in accordance with GDSR specifications by using exclude_base_abn
.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb %>% mutate( ONTRTFL = case_when( AVISIT %in% c("SCREENING", "BASELINE") ~ "", TRUE ~ "Y" ) %>% with_label("On Treatment Record Flag") ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_abnormality( label = "Abnormality Table", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), add_total = FALSE, by_vars = choices_selected( choices = variable_choices(ADLB, subset = c("LBCAT", "PARAM", "AVISIT")), selected = c("LBCAT", "PARAM"), keep_order = TRUE ), baseline_var = choices_selected( variable_choices(ADLB, subset = "BNRIND"), selected = "BNRIND", fixed = TRUE ), grade = choices_selected( choices = variable_choices(ADLB, subset = "ANRIND"), selected = "ANRIND", fixed = TRUE ), abnormal = list(low = "LOW", high = "HIGH"), exclude_base_abn = FALSE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb %>% mutate( ONTRTFL = case_when( AVISIT %in% c("SCREENING", "BASELINE") ~ "", TRUE ~ "Y" ) %>% with_label("On Treatment Record Flag") ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_abnormality( label = "Abnormality Table", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), add_total = FALSE, by_vars = choices_selected( choices = variable_choices(ADLB, subset = c("LBCAT", "PARAM", "AVISIT")), selected = c("LBCAT", "PARAM"), keep_order = TRUE ), baseline_var = choices_selected( variable_choices(ADLB, subset = "BNRIND"), selected = "BNRIND", fixed = TRUE ), grade = choices_selected( choices = variable_choices(ADLB, subset = "ANRIND"), selected = "ANRIND", fixed = TRUE ), abnormal = list(low = "LOW", high = "HIGH"), exclude_base_abn = FALSE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table to summarize laboratory test results with highest grade post-baseline
tm_t_abnormality_by_worst_grade( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), paramcd, atoxgr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "ATOXGR"), selected = "ATOXGR", fixed = TRUE), worst_high_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "WGRHIFL"), selected = "WGRHIFL", fixed = TRUE), worst_low_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "WGRLOFL"), selected = "WGRLOFL", fixed = TRUE), worst_flag_indicator = teal.transform::choices_selected("Y"), add_total = TRUE, total_label = default_total_label(), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_abnormality_by_worst_grade( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), paramcd, atoxgr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "ATOXGR"), selected = "ATOXGR", fixed = TRUE), worst_high_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "WGRHIFL"), selected = "WGRHIFL", fixed = TRUE), worst_low_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "WGRLOFL"), selected = "WGRLOFL", fixed = TRUE), worst_flag_indicator = teal.transform::choices_selected("Y"), add_total = TRUE, total_label = default_total_label(), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
id_var |
( |
paramcd |
( |
atoxgr_var |
( |
worst_high_flag_var |
( |
worst_low_flag_var |
( |
worst_flag_indicator |
( |
add_total |
( |
total_label |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb %>% filter(!AVISIT %in% c("SCREENING", "BASELINE")) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_abnormality_by_worst_grade( label = "Laboratory Test Results with Highest Grade Post-Baseline", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = c("ALT", "CRP", "IGA") ), add_total = FALSE ) ), filter = teal_slices( teal_slice("ADSL", "SAFFL", selected = "Y"), teal_slice("ADLB", "ONTRTFL", selected = "Y") ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb %>% filter(!AVISIT %in% c("SCREENING", "BASELINE")) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_abnormality_by_worst_grade( label = "Laboratory Test Results with Highest Grade Post-Baseline", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = c("ALT", "CRP", "IGA") ), add_total = FALSE ) ), filter = teal_slices( teal_slice("ADSL", "SAFFL", selected = "Y"), teal_slice("ADLB", "ONTRTFL", selected = "Y") ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table to summarize analysis of variance, consistent with the TLG Catalog
template for AOVT01
available here when multiple
endpoints are selected.
tm_t_ancova( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, aval_var, cov_var, include_interact = FALSE, interact_var = NULL, interact_y = FALSE, avisit, paramcd, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_ancova( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, aval_var, cov_var, include_interact = FALSE, interact_var = NULL, interact_y = FALSE, avisit, paramcd, conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
aval_var |
( |
cov_var |
( |
include_interact |
( |
interact_var |
( |
interact_y |
( |
avisit |
( |
paramcd |
( |
conf_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
When a single endpoint is selected, both unadjusted and adjusted comparison are provided. This modules expects that the analysis data has the following variables:
AVISIT
: variable used to filter for analysis visits.
PARAMCD
: variable used to filter for endpoints, after filtering for paramcd
and avisit
, one
observation per patient is expected for the analysis to be meaningful.
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADQS <- tmc_ex_adqs }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADQS <- data[["ADQS"]] arm_ref_comp <- list( ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ), ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) app <- init( data = data, modules = modules( tm_t_ancova( label = "ANCOVA Table", dataname = "ADQS", avisit = choices_selected( choices = value_choices(ADQS, "AVISIT"), selected = "WEEK 1 DAY 8" ), arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ACTARMCD", "ARMCD")), selected = "ARMCD" ), arm_ref_comp = arm_ref_comp, aval_var = choices_selected( choices = variable_choices(ADQS, c("CHG", "AVAL")), selected = "CHG" ), cov_var = choices_selected( choices = variable_choices(ADQS, c("BASE", "STRATA1", "SEX")), selected = "STRATA1" ), paramcd = choices_selected( choices = value_choices(ADQS, "PARAMCD", "PARAM"), selected = "FKSI-FWB" ), interact_var = choices_selected( choices = variable_choices(ADQS, c("BASE", "STRATA1", "SEX")), selected = "STRATA1" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADQS <- tmc_ex_adqs }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADQS <- data[["ADQS"]] arm_ref_comp <- list( ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ), ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ) ) app <- init( data = data, modules = modules( tm_t_ancova( label = "ANCOVA Table", dataname = "ADQS", avisit = choices_selected( choices = value_choices(ADQS, "AVISIT"), selected = "WEEK 1 DAY 8" ), arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ACTARMCD", "ARMCD")), selected = "ARMCD" ), arm_ref_comp = arm_ref_comp, aval_var = choices_selected( choices = variable_choices(ADQS, c("CHG", "AVAL")), selected = "CHG" ), cov_var = choices_selected( choices = variable_choices(ADQS, c("BASE", "STRATA1", "SEX")), selected = "STRATA1" ), paramcd = choices_selected( choices = value_choices(ADQS, "PARAMCD", "PARAM"), selected = "FKSI-FWB" ), interact_var = choices_selected( choices = variable_choices(ADQS, c("BASE", "STRATA1", "SEX")), selected = "STRATA1" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a binary outcome response summary table, with the option to match the template for
response table RSPT01
available in the TLG Catalog here.
tm_t_binary_outcome( label, dataname, parentname = ifelse(test = inherits(arm_var, "data_extract_spec"), yes = teal.transform::datanames_input(arm_var), no = "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, strata_var, aval_var = teal.transform::choices_selected(choices = teal.transform::variable_choices(dataname, c("AVALC", "SEX")), selected = "AVALC", fixed = FALSE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), default_responses = c("CR", "PR", "Y", "Complete Response (CR)", "Partial Response (PR)", "M"), rsp_table = FALSE, control = list(global = list(method = ifelse(rsp_table, "clopper-pearson", "waldcc"), conf_level = 0.95), unstrat = list(method_ci = ifelse(rsp_table, "wald", "waldcc"), method_test = "schouten", odds = TRUE), strat = list(method_ci = "cmh", method_test = "cmh")), add_total = FALSE, total_label = default_total_label(), na_level = default_na_str(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_binary_outcome( label, dataname, parentname = ifelse(test = inherits(arm_var, "data_extract_spec"), yes = teal.transform::datanames_input(arm_var), no = "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, strata_var, aval_var = teal.transform::choices_selected(choices = teal.transform::variable_choices(dataname, c("AVALC", "SEX")), selected = "AVALC", fixed = FALSE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), default_responses = c("CR", "PR", "Y", "Complete Response (CR)", "Partial Response (PR)", "M"), rsp_table = FALSE, control = list(global = list(method = ifelse(rsp_table, "clopper-pearson", "waldcc"), conf_level = 0.95), unstrat = list(method_ci = ifelse(rsp_table, "wald", "waldcc"), method_test = "schouten", odds = TRUE), strat = list(method_ci = "cmh", method_test = "cmh")), add_total = FALSE, total_label = default_total_label(), na_level = default_na_str(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
paramcd |
( |
strata_var |
( |
aval_var |
( |
conf_level |
( |
default_responses |
( |
rsp_table |
( |
control |
(named
|
add_total |
( |
total_label |
( |
na_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
The display order of response categories inherits the factor level order of the source data. Use
base::factor()
and its levels
argument to manipulate the source data in order to include/exclude
or re-categorize response categories and arrange the display order. If response categories are "Missing"
,
"Not Evaluable (NE)"
, or "Missing or unevaluable"
, 95% confidence interval will not be calculated.
Reference arms are automatically combined if multiple arms selected as reference group.
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADRS <- tmc_ex_adrs %>% mutate( AVALC = d_onco_rsp_label(AVALC) %>% with_label("Character Result/Finding") ) %>% filter(PARAMCD != "OVRINV" | AVISIT == "FOLLOW UP") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADRS <- data[["ADRS"]] arm_ref_comp <- list( ARMCD = list(ref = "ARM B", comp = c("ARM A", "ARM C")), ARM = list(ref = "B: Placebo", comp = c("A: Drug X", "C: Combination")) ) app <- init( data = data, modules = modules( tm_t_binary_outcome( label = "Responders", dataname = "ADRS", paramcd = choices_selected( choices = value_choices(ADRS, "PARAMCD", "PARAM"), selected = "BESRSPI" ), arm_var = choices_selected( choices = variable_choices(ADRS, c("ARM", "ARMCD", "ACTARMCD")), selected = "ARM" ), arm_ref_comp = arm_ref_comp, strata_var = choices_selected( choices = variable_choices(ADRS, c("SEX", "BMRKR2", "RACE")), selected = "RACE" ), default_responses = list( BESRSPI = list( rsp = c("Complete Response (CR)", "Partial Response (PR)"), levels = c( "Complete Response (CR)", "Partial Response (PR)", "Stable Disease (SD)", "Progressive Disease (PD)" ) ), INVET = list( rsp = c("Stable Disease (SD)", "Not Evaluable (NE)"), levels = c( "Complete Response (CR)", "Not Evaluable (NE)", "Partial Response (PR)", "Progressive Disease (PD)", "Stable Disease (SD)" ) ), OVRINV = list( rsp = c("Progressive Disease (PD)", "Stable Disease (SD)"), levels = c("Progressive Disease (PD)", "Stable Disease (SD)", "Not Evaluable (NE)") ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADRS <- tmc_ex_adrs %>% mutate( AVALC = d_onco_rsp_label(AVALC) %>% with_label("Character Result/Finding") ) %>% filter(PARAMCD != "OVRINV" | AVISIT == "FOLLOW UP") }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADRS <- data[["ADRS"]] arm_ref_comp <- list( ARMCD = list(ref = "ARM B", comp = c("ARM A", "ARM C")), ARM = list(ref = "B: Placebo", comp = c("A: Drug X", "C: Combination")) ) app <- init( data = data, modules = modules( tm_t_binary_outcome( label = "Responders", dataname = "ADRS", paramcd = choices_selected( choices = value_choices(ADRS, "PARAMCD", "PARAM"), selected = "BESRSPI" ), arm_var = choices_selected( choices = variable_choices(ADRS, c("ARM", "ARMCD", "ACTARMCD")), selected = "ARM" ), arm_ref_comp = arm_ref_comp, strata_var = choices_selected( choices = variable_choices(ADRS, c("SEX", "BMRKR2", "RACE")), selected = "RACE" ), default_responses = list( BESRSPI = list( rsp = c("Complete Response (CR)", "Partial Response (PR)"), levels = c( "Complete Response (CR)", "Partial Response (PR)", "Stable Disease (SD)", "Progressive Disease (PD)" ) ), INVET = list( rsp = c("Stable Disease (SD)", "Not Evaluable (NE)"), levels = c( "Complete Response (CR)", "Not Evaluable (NE)", "Partial Response (PR)", "Progressive Disease (PD)", "Stable Disease (SD)" ) ), OVRINV = list( rsp = c("Progressive Disease (PD)", "Stable Disease (SD)"), levels = c("Progressive Disease (PD)", "Stable Disease (SD)", "Not Evaluable (NE)") ) ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module fits Cox univariable or multi-variable models, consistent with the TLG Catalog
templates for Cox regression tables COXT01
and COXT02
, respectively. See the TLG Catalog entries
for COXT01
here
and COXT02
here.
tm_t_coxreg( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, cov_var, strata_var, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), multivariate = TRUE, na_level = default_na_str(), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_coxreg( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, cov_var, strata_var, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), multivariate = TRUE, na_level = default_na_str(), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
paramcd |
( |
cov_var |
( |
strata_var |
( |
aval_var |
( |
cnsr_var |
( |
multivariate |
( |
na_level |
( |
conf_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
The Cox Proportional Hazards (PH) model is the most commonly used method to estimate the magnitude of the effect in survival analysis. It assumes proportional hazards: the ratio of the hazards between groups (e.g., two arms) is constant over time. This ratio is referred to as the "hazard ratio" (HR) and is one of the most commonly reported metrics to describe the effect size in survival analysis.
This modules expects that the analysis data has the following variables:
AVAL
: time to event
CNSR
: 1 if record in AVAL
is censored, 0 otherwise
PARAMCD
: variable used to filter for endpoint (e.g. OS). After
filtering for PARAMCD
one observation per patient is expected
The arm variables and stratification/covariate variables are taken from the ADSL
data.
a teal_module
object.
The likelihood ratio test is not supported for models that include strata - the Wald test will be substituted in these cases.
Multi-variable is the default choice for backward compatibility.
The TLG Catalog where additional example apps implementing this module can be found.
## First example ## ============= ## The example below is based on the usual approach involving creation of ## a random CDISC dataset and then running the application. arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] app <- init( data = data, modules = modules( tm_t_coxreg( label = "Cox Reg.", dataname = "ADTTE", arm_var = choices_selected(c("ARM", "ARMCD", "ACTARMCD"), "ARM"), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), strata_var = choices_selected( c("COUNTRY", "STRATA1", "STRATA2"), "STRATA1" ), cov_var = choices_selected( c("AGE", "BMRKR1", "BMRKR2", "REGION1"), "AGE" ), multivariate = TRUE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } ## Second example ## ============== ## This time, a synthetic pair of ADTTE/ADSL data is fabricated for Cox regression ## where ties and pval_method matter. library(dplyr) data <- teal_data() data <- within(data, { ADTTE <- data.frame( STUDYID = "LUNG", AVAL = c(4, 3, 1, 1, 2, 2, 3, 1, 2), CNSR = c(1, 1, 1, 0, 1, 1, 0, 0, 0), ARMCD = factor( c(0, 1, 1, 1, 1, 0, 0, 0, 0), labels = c("ARM A", "ARM B") ), SEX = factor( c(0, 0, 0, 0, 1, 1, 1, 1, 1), labels = c("F", "M") ), INST = factor(c("A", "A", "B", "B", "A", "B", "A", "B", "A")), stringsAsFactors = FALSE ) ADTTE <- rbind(ADTTE, ADTTE, ADTTE, ADTTE) ADTTE <- as_tibble(ADTTE) set.seed(1) ADTTE$INST <- sample(ADTTE$INST) ADTTE$AGE <- sample(seq(5, 75, 5), size = nrow(ADTTE), replace = TRUE) ADTTE$USUBJID <- paste("sub", 1:nrow(ADTTE), ADTTE$INST, sep = "-") ADTTE$PARAM <- ADTTE$PARAMCD <- "OS" ADSL <- subset( ADTTE, select = c("USUBJID", "STUDYID", "ARMCD", "SEX", "INST", "AGE") ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] ## `teal` application ## ---------------- ## Note that the R code exported by `Show R Code` does not include the data ## pre-processing. You will need to create the dataset as above before ## running the exported R code. arm_ref_comp <- list(ARMCD = list(ref = "ARM A", comp = c("ARM B"))) app <- init( data = data, modules = modules( tm_t_coxreg( label = "Cox Reg.", dataname = "ADTTE", arm_var = choices_selected(c("ARMCD"), "ARMCD"), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), strata_var = choices_selected(c("INST"), NULL), cov_var = choices_selected(c("SEX", "AGE"), "SEX"), multivariate = TRUE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
## First example ## ============= ## The example below is based on the usual approach involving creation of ## a random CDISC dataset and then running the application. arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] app <- init( data = data, modules = modules( tm_t_coxreg( label = "Cox Reg.", dataname = "ADTTE", arm_var = choices_selected(c("ARM", "ARMCD", "ACTARMCD"), "ARM"), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), strata_var = choices_selected( c("COUNTRY", "STRATA1", "STRATA2"), "STRATA1" ), cov_var = choices_selected( c("AGE", "BMRKR1", "BMRKR2", "REGION1"), "AGE" ), multivariate = TRUE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } ## Second example ## ============== ## This time, a synthetic pair of ADTTE/ADSL data is fabricated for Cox regression ## where ties and pval_method matter. library(dplyr) data <- teal_data() data <- within(data, { ADTTE <- data.frame( STUDYID = "LUNG", AVAL = c(4, 3, 1, 1, 2, 2, 3, 1, 2), CNSR = c(1, 1, 1, 0, 1, 1, 0, 0, 0), ARMCD = factor( c(0, 1, 1, 1, 1, 0, 0, 0, 0), labels = c("ARM A", "ARM B") ), SEX = factor( c(0, 0, 0, 0, 1, 1, 1, 1, 1), labels = c("F", "M") ), INST = factor(c("A", "A", "B", "B", "A", "B", "A", "B", "A")), stringsAsFactors = FALSE ) ADTTE <- rbind(ADTTE, ADTTE, ADTTE, ADTTE) ADTTE <- as_tibble(ADTTE) set.seed(1) ADTTE$INST <- sample(ADTTE$INST) ADTTE$AGE <- sample(seq(5, 75, 5), size = nrow(ADTTE), replace = TRUE) ADTTE$USUBJID <- paste("sub", 1:nrow(ADTTE), ADTTE$INST, sep = "-") ADTTE$PARAM <- ADTTE$PARAMCD <- "OS" ADSL <- subset( ADTTE, select = c("USUBJID", "STUDYID", "ARMCD", "SEX", "INST", "AGE") ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] ## `teal` application ## ---------------- ## Note that the R code exported by `Show R Code` does not include the data ## pre-processing. You will need to create the dataset as above before ## running the exported R code. arm_ref_comp <- list(ARMCD = list(ref = "ARM A", comp = c("ARM B"))) app <- init( data = data, modules = modules( tm_t_coxreg( label = "Cox Reg.", dataname = "ADTTE", arm_var = choices_selected(c("ARMCD"), "ARMCD"), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), strata_var = choices_selected(c("INST"), NULL), cov_var = choices_selected(c("SEX", "AGE"), "SEX"), multivariate = TRUE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table of events by term.
tm_t_events( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, hlt, llt, add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), event_type = "event", sort_criteria = c("freq_desc", "alpha"), sort_freq_col = total_label, prune_freq = 0, prune_diff = 0, drop_arm_levels = TRUE, incl_overall_sum = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_events( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, hlt, llt, add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), event_type = "event", sort_criteria = c("freq_desc", "alpha"), sort_freq_col = total_label, prune_freq = 0, prune_diff = 0, drop_arm_levels = TRUE, incl_overall_sum = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
hlt |
( |
llt |
( |
add_total |
( |
total_label |
( |
na_level |
( |
event_type |
( |
sort_criteria |
( |
sort_freq_col |
( |
prune_freq |
( |
prune_diff |
( |
drop_arm_levels |
( |
incl_overall_sum |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADAE <- tmc_ex_adae }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_t_events( label = "Adverse Event Table", dataname = "ADAE", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), llt = choices_selected( choices = variable_choices(ADAE, c("AETERM", "AEDECOD")), selected = c("AEDECOD") ), hlt = choices_selected( choices = variable_choices(ADAE, c("AEBODSYS", "AESOC")), selected = "AEBODSYS" ), add_total = TRUE, event_type = "adverse event" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADAE <- tmc_ex_adae }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_t_events( label = "Adverse Event Table", dataname = "ADAE", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), llt = choices_selected( choices = variable_choices(ADAE, c("AETERM", "AEDECOD")), selected = c("AEDECOD") ), hlt = choices_selected( choices = variable_choices(ADAE, c("AEBODSYS", "AESOC")), selected = "AEBODSYS" ), add_total = TRUE, event_type = "adverse event" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table to summarize events by grade.
tm_t_events_by_grade( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, hlt, llt, grade, grading_groups = list(`Any Grade (%)` = c("1", "2", "3", "4", "5"), `Grade 1-2 (%)` = c("1", "2"), `Grade 3-4 (%)` = c("3", "4"), `Grade 5 (%)` = "5"), col_by_grade = FALSE, prune_freq = 0, prune_diff = 0, add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_events_by_grade( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, hlt, llt, grade, grading_groups = list(`Any Grade (%)` = c("1", "2", "3", "4", "5"), `Grade 1-2 (%)` = c("1", "2"), `Grade 3-4 (%)` = c("3", "4"), `Grade 5 (%)` = "5"), col_by_grade = FALSE, prune_freq = 0, prune_diff = 0, add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
hlt |
( |
llt |
( |
grade |
( |
grading_groups |
( |
col_by_grade |
( |
prune_freq |
( |
prune_diff |
( |
add_total |
( |
total_label |
( |
na_level |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl .lbls_adae <- col_labels(tmc_ex_adae) ADAE <- tmc_ex_adae %>% mutate_if(is.character, as.factor) #' be certain of having factors col_labels(ADAE) <- .lbls_adae }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_t_events_by_grade( label = "Adverse Events by Grade Table", dataname = "ADAE", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), llt = choices_selected( choices = variable_choices(ADAE, c("AETERM", "AEDECOD")), selected = c("AEDECOD") ), hlt = choices_selected( choices = variable_choices(ADAE, c("AEBODSYS", "AESOC")), selected = "AEBODSYS" ), grade = choices_selected( choices = variable_choices(ADAE, c("AETOXGR", "AESEV")), selected = "AETOXGR" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl .lbls_adae <- col_labels(tmc_ex_adae) ADAE <- tmc_ex_adae %>% mutate_if(is.character, as.factor) #' be certain of having factors col_labels(ADAE) <- .lbls_adae }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAE <- data[["ADAE"]] app <- init( data = data, modules = modules( tm_t_events_by_grade( label = "Adverse Events by Grade Table", dataname = "ADAE", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), llt = choices_selected( choices = variable_choices(ADAE, c("AETERM", "AEDECOD")), selected = c("AEDECOD") ), hlt = choices_selected( choices = variable_choices(ADAE, c("AEBODSYS", "AESOC")), selected = "AEBODSYS" ), grade = choices_selected( choices = variable_choices(ADAE, c("AETOXGR", "AESEV")), selected = "AETOXGR" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table of event rates adjusted for patient-years.
tm_t_events_patyear( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, events_var, paramcd, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_events_patyear( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, events_var, paramcd, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
events_var |
( |
paramcd |
( |
aval_var |
( |
avalu_var |
( |
add_total |
( |
total_label |
( |
na_level |
( |
conf_level |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADAETTE <- tmc_ex_adaette %>% filter(PARAMCD %in% c("AETTE1", "AETTE2", "AETTE3")) %>% mutate(is_event = CNSR == 0) %>% mutate(n_events = as.integer(is_event)) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAETTE <- data[["ADAETTE"]] # 1. Basic Example app <- init( data = data, modules = modules( tm_t_events_patyear( label = "AE Rate Adjusted for Patient-Years At Risk Table", dataname = "ADAETTE", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARMCD" ), add_total = TRUE, events_var = choices_selected( choices = variable_choices(ADAETTE, "n_events"), selected = "n_events", fixed = TRUE ), paramcd = choices_selected( choices = value_choices(ADAETTE, "PARAMCD", "PARAM"), selected = "AETTE1" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # 2. Example with table split on 2 arm_var variables app <- init( data = data, modules = modules( tm_t_events_patyear( label = "AE Rate Adjusted for Patient-Years At Risk Table", dataname = "ADAETTE", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD", "SEX")), selected = c("ARM", "SEX") ), add_total = TRUE, events_var = choices_selected( choices = variable_choices(ADAETTE, "n_events"), selected = "n_events", fixed = TRUE ), paramcd = choices_selected( choices = value_choices(ADAETTE, "PARAMCD", "PARAM"), selected = "AETTE1" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADAETTE <- tmc_ex_adaette %>% filter(PARAMCD %in% c("AETTE1", "AETTE2", "AETTE3")) %>% mutate(is_event = CNSR == 0) %>% mutate(n_events = as.integer(is_event)) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADAETTE <- data[["ADAETTE"]] # 1. Basic Example app <- init( data = data, modules = modules( tm_t_events_patyear( label = "AE Rate Adjusted for Patient-Years At Risk Table", dataname = "ADAETTE", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARMCD" ), add_total = TRUE, events_var = choices_selected( choices = variable_choices(ADAETTE, "n_events"), selected = "n_events", fixed = TRUE ), paramcd = choices_selected( choices = value_choices(ADAETTE, "PARAMCD", "PARAM"), selected = "AETTE1" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # 2. Example with table split on 2 arm_var variables app <- init( data = data, modules = modules( tm_t_events_patyear( label = "AE Rate Adjusted for Patient-Years At Risk Table", dataname = "ADAETTE", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD", "SEX")), selected = c("ARM", "SEX") ), add_total = TRUE, events_var = choices_selected( choices = variable_choices(ADAETTE, "n_events"), selected = "n_events", fixed = TRUE ), paramcd = choices_selected( choices = value_choices(ADAETTE, "PARAMCD", "PARAM"), selected = "AETTE1" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces an adverse events summary table.
tm_t_events_summary( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, flag_var_anl = NULL, flag_var_aesi = NULL, dthfl_var = teal.transform::choices_selected(teal.transform::variable_choices(parentname, "DTHFL"), "DTHFL", fixed = TRUE), dcsreas_var = teal.transform::choices_selected(teal.transform::variable_choices(parentname, "DCSREAS"), "DCSREAS", fixed = TRUE), llt = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AEDECOD"), "AEDECOD", fixed = TRUE), aeseq_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AESEQ"), "AESEQ", fixed = TRUE), add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), count_dth = TRUE, count_wd = TRUE, count_subj = TRUE, count_pt = TRUE, count_events = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_events_summary( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, flag_var_anl = NULL, flag_var_aesi = NULL, dthfl_var = teal.transform::choices_selected(teal.transform::variable_choices(parentname, "DTHFL"), "DTHFL", fixed = TRUE), dcsreas_var = teal.transform::choices_selected(teal.transform::variable_choices(parentname, "DCSREAS"), "DCSREAS", fixed = TRUE), llt = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AEDECOD"), "AEDECOD", fixed = TRUE), aeseq_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AESEQ"), "AESEQ", fixed = TRUE), add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), count_dth = TRUE, count_wd = TRUE, count_subj = TRUE, count_pt = TRUE, count_events = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
flag_var_anl |
( |
flag_var_aesi |
( |
dthfl_var |
( |
dcsreas_var |
( |
llt |
( |
aeseq_var |
( |
add_total |
( |
total_label |
( |
na_level |
( |
count_dth |
( |
count_wd |
( |
count_subj |
( |
count_pt |
( |
count_events |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl %>% mutate( DTHFL = case_when( !is.na(DTHDT) ~ "Y", TRUE ~ "" ) %>% with_label("Subject Death Flag") ) ADAE <- tmc_ex_adae .add_event_flags <- function(dat) { dat <- dat %>% mutate( TMPFL_SER = AESER == "Y", TMPFL_REL = AEREL == "Y", TMPFL_GR5 = AETOXGR == "5", TMP_SMQ01 = !is.na(SMQ01NAM), TMP_SMQ02 = !is.na(SMQ02NAM), TMP_CQ01 = !is.na(CQ01NAM) ) column_labels <- list( TMPFL_SER = "Serious AE", TMPFL_REL = "Related AE", TMPFL_GR5 = "Grade 5 AE", TMP_SMQ01 = aesi_label(dat[["SMQ01NAM"]], dat[["SMQ01SC"]]), TMP_SMQ02 = aesi_label("Y.9.9.9.9/Z.9.9.9.9 AESI"), TMP_CQ01 = aesi_label(dat[["CQ01NAM"]]) ) col_labels(dat)[names(column_labels)] <- as.character(column_labels) dat } #' Generating user-defined event flags. ADAE <- ADAE %>% .add_event_flags() .ae_anl_vars <- names(ADAE)[startsWith(names(ADAE), "TMPFL_")] .aesi_vars <- names(ADAE)[startsWith(names(ADAE), "TMP_")] }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_t_events_summary( label = "Adverse Events Summary", dataname = "ADAE", arm_var = choices_selected( choices = variable_choices("ADSL", c("ARM", "ARMCD")), selected = "ARM" ), flag_var_anl = choices_selected( choices = variable_choices("ADAE", data[[".ae_anl_vars"]]), selected = data[[".ae_anl_vars"]][1], keep_order = TRUE, fixed = FALSE ), flag_var_aesi = choices_selected( choices = variable_choices("ADAE", data[[".aesi_vars"]]), selected = data[[".aesi_vars"]][1], keep_order = TRUE, fixed = FALSE ), add_total = TRUE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl %>% mutate( DTHFL = case_when( !is.na(DTHDT) ~ "Y", TRUE ~ "" ) %>% with_label("Subject Death Flag") ) ADAE <- tmc_ex_adae .add_event_flags <- function(dat) { dat <- dat %>% mutate( TMPFL_SER = AESER == "Y", TMPFL_REL = AEREL == "Y", TMPFL_GR5 = AETOXGR == "5", TMP_SMQ01 = !is.na(SMQ01NAM), TMP_SMQ02 = !is.na(SMQ02NAM), TMP_CQ01 = !is.na(CQ01NAM) ) column_labels <- list( TMPFL_SER = "Serious AE", TMPFL_REL = "Related AE", TMPFL_GR5 = "Grade 5 AE", TMP_SMQ01 = aesi_label(dat[["SMQ01NAM"]], dat[["SMQ01SC"]]), TMP_SMQ02 = aesi_label("Y.9.9.9.9/Z.9.9.9.9 AESI"), TMP_CQ01 = aesi_label(dat[["CQ01NAM"]]) ) col_labels(dat)[names(column_labels)] <- as.character(column_labels) dat } #' Generating user-defined event flags. ADAE <- ADAE %>% .add_event_flags() .ae_anl_vars <- names(ADAE)[startsWith(names(ADAE), "TMPFL_")] .aesi_vars <- names(ADAE)[startsWith(names(ADAE), "TMP_")] }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_t_events_summary( label = "Adverse Events Summary", dataname = "ADAE", arm_var = choices_selected( choices = variable_choices("ADSL", c("ARM", "ARMCD")), selected = "ARM" ), flag_var_anl = choices_selected( choices = variable_choices("ADAE", data[[".ae_anl_vars"]]), selected = data[[".ae_anl_vars"]][1], keep_order = TRUE, fixed = FALSE ), flag_var_aesi = choices_selected( choices = variable_choices("ADAE", data[[".aesi_vars"]]), selected = data[[".aesi_vars"]][1], keep_order = TRUE, fixed = FALSE ), add_total = TRUE ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
The module produces an exposure table for risk management plan.
tm_t_exposure( label, dataname, parentname = ifelse(inherits(col_by_var, "data_extract_spec"), teal.transform::datanames_input(col_by_var), "ADSL"), row_by_var, col_by_var, paramcd = teal.transform::choices_selected(choices = teal.transform::value_choices(dataname, "PARAMCD", "PARAM"), selected = "TDURD"), paramcd_label = "PARAM", id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), parcat, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "AVAL"), selected = "AVAL", fixed = TRUE), avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "AVALU"), selected = "AVALU", fixed = TRUE), add_total, total_label = default_total_label(), add_total_row = TRUE, total_row_label = "Total number of patients and patient time*", na_level = default_na_str(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_exposure( label, dataname, parentname = ifelse(inherits(col_by_var, "data_extract_spec"), teal.transform::datanames_input(col_by_var), "ADSL"), row_by_var, col_by_var, paramcd = teal.transform::choices_selected(choices = teal.transform::value_choices(dataname, "PARAMCD", "PARAM"), selected = "TDURD"), paramcd_label = "PARAM", id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), parcat, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "AVAL"), selected = "AVAL", fixed = TRUE), avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "AVALU"), selected = "AVALU", fixed = TRUE), add_total, total_label = default_total_label(), add_total_row = TRUE, total_row_label = "Total number of patients and patient time*", na_level = default_na_str(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
row_by_var |
( |
col_by_var |
( |
paramcd |
( |
paramcd_label |
( |
id_var |
( |
parcat |
( |
aval_var |
( |
avalu_var |
( |
add_total |
( |
total_label |
( |
add_total_row |
( |
total_row_label |
( |
na_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADEX <- tmc_ex_adex set.seed(1, kind = "Mersenne-Twister") .labels <- col_labels(ADEX, fill = FALSE) ADEX <- ADEX %>% distinct(USUBJID, .keep_all = TRUE) %>% mutate( PARAMCD = "TDURD", PARAM = "Overall duration (days)", AVAL = sample(x = seq(1, 200), size = n(), replace = TRUE), AVALU = "Days" ) %>% bind_rows(ADEX) col_labels(ADEX) <- .labels }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_t_exposure( label = "Duration of Exposure Table", dataname = "ADEX", paramcd = choices_selected( choices = value_choices(data[["ADEX"]], "PARAMCD", "PARAM"), selected = "TDURD" ), col_by_var = choices_selected( choices = variable_choices(data[["ADEX"]], subset = c("SEX", "ARM")), selected = "SEX" ), row_by_var = choices_selected( choices = variable_choices(data[["ADEX"]], subset = c("RACE", "REGION1", "STRATA1", "SEX")), selected = "RACE" ), parcat = choices_selected( choices = value_choices(data[["ADEX"]], "PARCAT2"), selected = "Drug A" ), add_total = FALSE ) ), filter = teal_slices(teal_slice("ADSL", "SAFFL", selected = "Y")) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADEX <- tmc_ex_adex set.seed(1, kind = "Mersenne-Twister") .labels <- col_labels(ADEX, fill = FALSE) ADEX <- ADEX %>% distinct(USUBJID, .keep_all = TRUE) %>% mutate( PARAMCD = "TDURD", PARAM = "Overall duration (days)", AVAL = sample(x = seq(1, 200), size = n(), replace = TRUE), AVALU = "Days" ) %>% bind_rows(ADEX) col_labels(ADEX) <- .labels }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_t_exposure( label = "Duration of Exposure Table", dataname = "ADEX", paramcd = choices_selected( choices = value_choices(data[["ADEX"]], "PARAMCD", "PARAM"), selected = "TDURD" ), col_by_var = choices_selected( choices = variable_choices(data[["ADEX"]], subset = c("SEX", "ARM")), selected = "SEX" ), row_by_var = choices_selected( choices = variable_choices(data[["ADEX"]], subset = c("RACE", "REGION1", "STRATA1", "SEX")), selected = "RACE" ), parcat = choices_selected( choices = value_choices(data[["ADEX"]], "PARCAT2"), selected = "Drug A" ), add_total = FALSE ) ), filter = teal_slices(teal_slice("ADSL", "SAFFL", selected = "Y")) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a multi-variable logistic regression table consistent with the TLG Catalog template
LGRT02
available here.
tm_t_logistic( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var = NULL, arm_ref_comp = NULL, paramcd, cov_var = NULL, avalc_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALC"), "AVALC", fixed = TRUE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_logistic( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var = NULL, arm_ref_comp = NULL, paramcd, cov_var = NULL, avalc_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALC"), "AVALC", fixed = TRUE), conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
paramcd |
( |
cov_var |
( |
avalc_var |
( |
conf_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADRS <- tmc_ex_adrs %>% filter(PARAMCD %in% c("BESRSPI", "INVET")) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADRS <- data[["ADRS"]] arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) app <- init( data = data, modules = modules( tm_t_logistic( label = "Logistic Regression", dataname = "ADRS", arm_var = choices_selected( choices = variable_choices(ADRS, c("ARM", "ARMCD")), selected = "ARM" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( choices = value_choices(ADRS, "PARAMCD", "PARAM"), selected = "BESRSPI" ), cov_var = choices_selected( choices = c("SEX", "AGE", "BMRKR1", "BMRKR2"), selected = "SEX" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADRS <- tmc_ex_adrs %>% filter(PARAMCD %in% c("BESRSPI", "INVET")) }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADRS <- data[["ADRS"]] arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) app <- init( data = data, modules = modules( tm_t_logistic( label = "Logistic Regression", dataname = "ADRS", arm_var = choices_selected( choices = variable_choices(ADRS, c("ARM", "ARMCD")), selected = "ARM" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( choices = value_choices(ADRS, "PARAMCD", "PARAM"), selected = "BESRSPI" ), cov_var = choices_selected( choices = c("SEX", "AGE", "BMRKR1", "BMRKR2"), selected = "SEX" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table of multiple events by term.
tm_t_mult_events( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, seq_var, hlt, llt, add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), event_type = "event", drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_mult_events( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, seq_var, hlt, llt, add_total = TRUE, total_label = default_total_label(), na_level = default_na_str(), event_type = "event", drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
seq_var |
( |
hlt |
( |
llt |
( |
add_total |
( |
total_label |
( |
na_level |
( |
event_type |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADCM <- tmc_ex_adcm }) join_keys(data) <- default_cdisc_join_keys[names(data)] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] app <- init( data = data, modules = modules( tm_t_mult_events( label = "Concomitant Medications by Medication Class and Preferred Name", dataname = "ADCM", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), seq_var = choices_selected("CMSEQ", selected = "CMSEQ", fixed = TRUE), hlt = choices_selected( choices = variable_choices(ADCM, c("ATC1", "ATC2", "ATC3", "ATC4")), selected = c("ATC1", "ATC2", "ATC3", "ATC4") ), llt = choices_selected( choices = variable_choices(ADCM, c("CMDECOD")), selected = c("CMDECOD") ), add_total = TRUE, event_type = "treatment" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADCM <- tmc_ex_adcm }) join_keys(data) <- default_cdisc_join_keys[names(data)] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] app <- init( data = data, modules = modules( tm_t_mult_events( label = "Concomitant Medications by Medication Class and Preferred Name", dataname = "ADCM", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), seq_var = choices_selected("CMSEQ", selected = "CMSEQ", fixed = TRUE), hlt = choices_selected( choices = variable_choices(ADCM, c("ATC1", "ATC2", "ATC3", "ATC4")), selected = c("ATC1", "ATC2", "ATC3", "ATC4") ), llt = choices_selected( choices = variable_choices(ADCM, c("CMDECOD")), selected = c("CMDECOD") ), add_total = TRUE, event_type = "treatment" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile basic info report using ADaM datasets.
tm_t_pp_basic_info( label, dataname = "ADSL", patient_col = "USUBJID", vars = NULL, pre_output = NULL, post_output = NULL )
tm_t_pp_basic_info( label, dataname = "ADSL", patient_col = "USUBJID", vars = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
patient_col |
( |
vars |
( |
pre_output |
( |
post_output |
( |
a teal_module
object.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] app <- init( data = data, modules = modules( tm_t_pp_basic_info( label = "Basic Info", dataname = "ADSL", patient_col = "USUBJID", vars = choices_selected( choices = variable_choices(ADSL), selected = c("ARM", "AGE", "SEX", "COUNTRY", "RACE", "EOSSTT") ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] app <- init( data = data, modules = modules( tm_t_pp_basic_info( label = "Basic Info", dataname = "ADSL", patient_col = "USUBJID", vars = choices_selected( choices = variable_choices(ADSL), selected = c("ARM", "AGE", "SEX", "COUNTRY", "RACE", "EOSSTT") ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile laboratory table using ADaM datasets.
tm_t_pp_laboratory( label, dataname = "ADLB", parentname = "ADSL", patient_col = "USUBJID", timepoints = NULL, aval = lifecycle::deprecated(), aval_var = NULL, avalu = lifecycle::deprecated(), avalu_var = NULL, param = NULL, paramcd = NULL, anrind = NULL, pre_output = NULL, post_output = NULL )
tm_t_pp_laboratory( label, dataname = "ADLB", parentname = "ADSL", patient_col = "USUBJID", timepoints = NULL, aval = lifecycle::deprecated(), aval_var = NULL, avalu = lifecycle::deprecated(), avalu_var = NULL, param = NULL, paramcd = NULL, anrind = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
parentname |
( |
patient_col |
( |
timepoints |
( |
aval |
|
aval_var |
( |
avalu |
|
avalu_var |
( |
param |
( |
paramcd |
( |
anrind |
( |
pre_output |
( |
post_output |
( |
a teal_module
object.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_pp_laboratory( label = "Vitals", dataname = "ADLB", patient_col = "USUBJID", paramcd = choices_selected( choices = variable_choices(ADLB, "PARAMCD"), selected = "PARAMCD" ), param = choices_selected( choices = variable_choices(ADLB, "PARAM"), selected = "PARAM" ), timepoints = choices_selected( choices = variable_choices(ADLB, "ADY"), selected = "ADY" ), anrind = choices_selected( choices = variable_choices(ADLB, "ANRIND"), selected = "ANRIND" ), aval_var = choices_selected( choices = variable_choices(ADLB, "AVAL"), selected = "AVAL" ), avalu_var = choices_selected( choices = variable_choices(ADLB, "AVALU"), selected = "AVALU" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_pp_laboratory( label = "Vitals", dataname = "ADLB", patient_col = "USUBJID", paramcd = choices_selected( choices = variable_choices(ADLB, "PARAMCD"), selected = "PARAMCD" ), param = choices_selected( choices = variable_choices(ADLB, "PARAM"), selected = "PARAM" ), timepoints = choices_selected( choices = variable_choices(ADLB, "ADY"), selected = "ADY" ), anrind = choices_selected( choices = variable_choices(ADLB, "ANRIND"), selected = "ANRIND" ), aval_var = choices_selected( choices = variable_choices(ADLB, "AVAL"), selected = "AVAL" ), avalu_var = choices_selected( choices = variable_choices(ADLB, "AVALU"), selected = "AVALU" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile medical history report using ADaM datasets.
tm_t_pp_medical_history( label, dataname = "ADMH", parentname = "ADSL", patient_col = "USUBJID", mhterm = NULL, mhbodsys = NULL, mhdistat = NULL, pre_output = NULL, post_output = NULL )
tm_t_pp_medical_history( label, dataname = "ADMH", parentname = "ADSL", patient_col = "USUBJID", mhterm = NULL, mhbodsys = NULL, mhdistat = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
parentname |
( |
patient_col |
( |
mhterm |
( |
mhbodsys |
( |
mhdistat |
( |
pre_output |
( |
post_output |
( |
a teal_module
object.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADMH <- tmc_ex_admh }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADMH <- data[["ADMH"]] app <- init( data = data, modules = modules( tm_t_pp_medical_history( label = "Medical History", dataname = "ADMH", parentname = "ADSL", patient_col = "USUBJID", mhterm = choices_selected( choices = variable_choices(ADMH, c("MHTERM")), selected = "MHTERM" ), mhbodsys = choices_selected( choices = variable_choices(ADMH, "MHBODSYS"), selected = "MHBODSYS" ), mhdistat = choices_selected( choices = variable_choices(ADMH, "MHDISTAT"), selected = "MHDISTAT" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADMH <- tmc_ex_admh }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADMH <- data[["ADMH"]] app <- init( data = data, modules = modules( tm_t_pp_medical_history( label = "Medical History", dataname = "ADMH", parentname = "ADSL", patient_col = "USUBJID", mhterm = choices_selected( choices = variable_choices(ADMH, c("MHTERM")), selected = "MHTERM" ), mhbodsys = choices_selected( choices = variable_choices(ADMH, "MHBODSYS"), selected = "MHBODSYS" ), mhdistat = choices_selected( choices = variable_choices(ADMH, "MHDISTAT"), selected = "MHDISTAT" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a patient profile prior medication report using ADaM datasets.
tm_t_pp_prior_medication( label, dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", atirel = NULL, cmdecod = NULL, cmindc = NULL, cmstdy = NULL, pre_output = NULL, post_output = NULL )
tm_t_pp_prior_medication( label, dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", atirel = NULL, cmdecod = NULL, cmindc = NULL, cmstdy = NULL, pre_output = NULL, post_output = NULL )
label |
( |
dataname |
( |
parentname |
( |
patient_col |
( |
atirel |
( |
cmdecod |
( |
cmindc |
( |
cmstdy |
( |
pre_output |
( |
post_output |
( |
a teal_module
object.
library(dplyr) data <- teal_data() data <- within(data, { ADCM <- tmc_ex_adcm ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADCM$USUBJID) ADCM$CMASTDTM <- ADCM$ASTDTM ADCM$CMAENDTM <- ADCM$AENDTM }) join_keys(data) <- default_cdisc_join_keys[names(data)] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] app <- init( data = data, modules = modules( tm_t_pp_prior_medication( label = "Prior Medication", dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", atirel = choices_selected( choices = variable_choices(ADCM, "ATIREL"), selected = "ATIREL" ), cmdecod = choices_selected( choices = variable_choices(ADCM, "CMDECOD"), selected = "CMDECOD" ), cmindc = choices_selected( choices = variable_choices(ADCM, "CMINDC"), selected = "CMINDC" ), cmstdy = choices_selected( choices = variable_choices(ADCM, "ASTDY"), selected = "ASTDY" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
library(dplyr) data <- teal_data() data <- within(data, { ADCM <- tmc_ex_adcm ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADCM$USUBJID) ADCM$CMASTDTM <- ADCM$ASTDTM ADCM$CMAENDTM <- ADCM$AENDTM }) join_keys(data) <- default_cdisc_join_keys[names(data)] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] app <- init( data = data, modules = modules( tm_t_pp_prior_medication( label = "Prior Medication", dataname = "ADCM", parentname = "ADSL", patient_col = "USUBJID", atirel = choices_selected( choices = variable_choices(ADCM, "ATIREL"), selected = "ATIREL" ), cmdecod = choices_selected( choices = variable_choices(ADCM, "CMDECOD"), selected = "CMDECOD" ), cmindc = choices_selected( choices = variable_choices(ADCM, "CMINDC"), selected = "CMINDC" ), cmstdy = choices_selected( choices = variable_choices(ADCM, "ASTDY"), selected = "ASTDY" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a summary table of analysis indicator levels by arm.
tm_t_shift_by_arm( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, paramcd, visit_var, aval_var, base_var = lifecycle::deprecated(), baseline_var, treatment_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "ONTRTFL"), selected = "ONTRTFL"), treatment_flag = teal.transform::choices_selected("Y"), useNA = c("ifany", "no"), na_level = default_na_str(), add_total = FALSE, total_label = default_total_label(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_shift_by_arm( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, paramcd, visit_var, aval_var, base_var = lifecycle::deprecated(), baseline_var, treatment_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "ONTRTFL"), selected = "ONTRTFL"), treatment_flag = teal.transform::choices_selected("Y"), useNA = c("ifany", "no"), na_level = default_na_str(), add_total = FALSE, total_label = default_total_label(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
paramcd |
( |
visit_var |
( |
aval_var |
( |
base_var |
|
baseline_var |
( |
treatment_flag_var |
( |
treatment_flag |
( |
useNA |
( |
na_level |
( |
add_total |
( |
total_label |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADEG <- tmc_ex_adeg }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADEG <- data[["ADEG"]] app <- init( data = data, modules = modules( tm_t_shift_by_arm( label = "Shift by Arm Table", dataname = "ADEG", arm_var = choices_selected( variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( value_choices(ADEG, "PARAMCD"), selected = "HR" ), visit_var = choices_selected( value_choices(ADEG, "AVISIT"), selected = "POST-BASELINE MINIMUM" ), aval_var = choices_selected( variable_choices(ADEG, subset = "ANRIND"), selected = "ANRIND", fixed = TRUE ), baseline_var = choices_selected( variable_choices(ADEG, subset = "BNRIND"), selected = "BNRIND", fixed = TRUE ), useNA = "ifany" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADEG <- tmc_ex_adeg }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADEG <- data[["ADEG"]] app <- init( data = data, modules = modules( tm_t_shift_by_arm( label = "Shift by Arm Table", dataname = "ADEG", arm_var = choices_selected( variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( value_choices(ADEG, "PARAMCD"), selected = "HR" ), visit_var = choices_selected( value_choices(ADEG, "AVISIT"), selected = "POST-BASELINE MINIMUM" ), aval_var = choices_selected( variable_choices(ADEG, subset = "ANRIND"), selected = "ANRIND", fixed = TRUE ), baseline_var = choices_selected( variable_choices(ADEG, subset = "BNRIND"), selected = "BNRIND", fixed = TRUE ), useNA = "ifany" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a summary table of worst analysis indicator variable level per subject by arm.
tm_t_shift_by_arm_by_worst( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, paramcd, aval_var, base_var = lifecycle::deprecated(), baseline_var, worst_flag_var, worst_flag, treatment_flag_var = teal.transform::choices_selected(choices = teal.transform::variable_choices(dataname, subset = "ONTRTFL"), selected = "ONTRTFL"), treatment_flag = teal.transform::choices_selected("Y"), useNA = c("ifany", "no"), na_level = default_na_str(), add_total = FALSE, total_label = default_total_label(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_shift_by_arm_by_worst( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, paramcd, aval_var, base_var = lifecycle::deprecated(), baseline_var, worst_flag_var, worst_flag, treatment_flag_var = teal.transform::choices_selected(choices = teal.transform::variable_choices(dataname, subset = "ONTRTFL"), selected = "ONTRTFL"), treatment_flag = teal.transform::choices_selected("Y"), useNA = c("ifany", "no"), na_level = default_na_str(), add_total = FALSE, total_label = default_total_label(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
paramcd |
( |
aval_var |
( |
base_var |
|
baseline_var |
( |
worst_flag_var |
( |
worst_flag |
( |
treatment_flag_var |
( |
treatment_flag |
( |
useNA |
( |
na_level |
( |
add_total |
( |
total_label |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADEG <- tmc_ex_adeg }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADEG <- data[["ADEG"]] app <- init( data = data, modules = modules( tm_t_shift_by_arm_by_worst( label = "Shift by Arm Table", dataname = "ADEG", arm_var = choices_selected( variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( value_choices(ADEG, "PARAMCD"), selected = "ECGINTP" ), worst_flag_var = choices_selected( variable_choices(ADEG, c("WORS02FL", "WORS01FL")), selected = "WORS02FL" ), worst_flag = choices_selected( value_choices(ADEG, "WORS02FL"), selected = "Y", fixed = TRUE ), aval_var = choices_selected( variable_choices(ADEG, c("AVALC", "ANRIND")), selected = "AVALC" ), baseline_var = choices_selected( variable_choices(ADEG, c("BASEC", "BNRIND")), selected = "BASEC" ), useNA = "ifany" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADEG <- tmc_ex_adeg }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADEG <- data[["ADEG"]] app <- init( data = data, modules = modules( tm_t_shift_by_arm_by_worst( label = "Shift by Arm Table", dataname = "ADEG", arm_var = choices_selected( variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( value_choices(ADEG, "PARAMCD"), selected = "ECGINTP" ), worst_flag_var = choices_selected( variable_choices(ADEG, c("WORS02FL", "WORS01FL")), selected = "WORS02FL" ), worst_flag = choices_selected( value_choices(ADEG, "WORS02FL"), selected = "Y", fixed = TRUE ), aval_var = choices_selected( variable_choices(ADEG, c("AVALC", "ANRIND")), selected = "AVALC" ), baseline_var = choices_selected( variable_choices(ADEG, c("BASEC", "BNRIND")), selected = "BASEC" ), useNA = "ifany" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a summary table of worst grades per subject by visit and parameter.
tm_t_shift_by_grade( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, visit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "AVISIT"), selected = "AVISIT", fixed = TRUE), paramcd, worst_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = c("WGRLOVFL", "WGRLOFL", "WGRHIVFL", "WGRHIFL")), selected = "WGRLOVFL"), worst_flag_indicator = teal.transform::choices_selected(teal.transform::value_choices(dataname, "WGRLOVFL"), selected = "Y", fixed = TRUE), anl_toxgrade_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = c("ATOXGR")), selected = c("ATOXGR"), fixed = TRUE), base_toxgrade_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = c("BTOXGR")), selected = c("BTOXGR"), fixed = TRUE), id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), add_total = FALSE, total_label = default_total_label(), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, na_level = default_na_str(), code_missing_baseline = FALSE, basic_table_args = teal.widgets::basic_table_args() )
tm_t_shift_by_grade( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, visit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "AVISIT"), selected = "AVISIT", fixed = TRUE), paramcd, worst_flag_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = c("WGRLOVFL", "WGRLOFL", "WGRHIVFL", "WGRHIFL")), selected = "WGRLOVFL"), worst_flag_indicator = teal.transform::choices_selected(teal.transform::value_choices(dataname, "WGRLOVFL"), selected = "Y", fixed = TRUE), anl_toxgrade_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = c("ATOXGR")), selected = c("ATOXGR"), fixed = TRUE), base_toxgrade_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = c("BTOXGR")), selected = c("BTOXGR"), fixed = TRUE), id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), add_total = FALSE, total_label = default_total_label(), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, na_level = default_na_str(), code_missing_baseline = FALSE, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
visit_var |
( |
paramcd |
( |
worst_flag_var |
( |
worst_flag_indicator |
( |
anl_toxgrade_var |
( |
base_toxgrade_var |
( |
id_var |
( |
add_total |
( |
total_label |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
na_level |
( |
code_missing_baseline |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_shift_by_grade( label = "Grade Laboratory Abnormality Table", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = "ALT" ), worst_flag_var = choices_selected( choices = variable_choices(ADLB, subset = c("WGRLOVFL", "WGRLOFL", "WGRHIVFL", "WGRHIFL")), selected = c("WGRLOVFL") ), worst_flag_indicator = choices_selected( value_choices(ADLB, "WGRLOVFL"), selected = "Y", fixed = TRUE ), anl_toxgrade_var = choices_selected( choices = variable_choices(ADLB, subset = c("ATOXGR")), selected = c("ATOXGR"), fixed = TRUE ), base_toxgrade_var = choices_selected( choices = variable_choices(ADLB, subset = c("BTOXGR")), selected = c("BTOXGR"), fixed = TRUE ), add_total = FALSE ) ), filter = teal_slices(teal_slice("ADSL", "SAFFL", selected = "Y")) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_shift_by_grade( label = "Grade Laboratory Abnormality Table", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")), selected = "ARM" ), paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = "ALT" ), worst_flag_var = choices_selected( choices = variable_choices(ADLB, subset = c("WGRLOVFL", "WGRLOFL", "WGRHIVFL", "WGRHIFL")), selected = c("WGRLOVFL") ), worst_flag_indicator = choices_selected( value_choices(ADLB, "WGRLOVFL"), selected = "Y", fixed = TRUE ), anl_toxgrade_var = choices_selected( choices = variable_choices(ADLB, subset = c("ATOXGR")), selected = c("ATOXGR"), fixed = TRUE ), base_toxgrade_var = choices_selected( choices = variable_choices(ADLB, subset = c("BTOXGR")), selected = c("BTOXGR"), fixed = TRUE ), add_total = FALSE ) ), filter = teal_slices(teal_slice("ADSL", "SAFFL", selected = "Y")) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces an adverse events table by Standardized MedDRA Query.
tm_t_smq( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), llt, add_total = TRUE, total_label = default_total_label(), sort_criteria = c("freq_desc", "alpha"), drop_arm_levels = TRUE, na_level = default_na_str(), smq_varlabel = "Standardized MedDRA Query", baskets, scopes, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_smq( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), llt, add_total = TRUE, total_label = default_total_label(), sort_criteria = c("freq_desc", "alpha"), drop_arm_levels = TRUE, na_level = default_na_str(), smq_varlabel = "Standardized MedDRA Query", baskets, scopes, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
id_var |
( |
llt |
( |
add_total |
( |
total_label |
( |
sort_criteria |
( |
drop_arm_levels |
( |
na_level |
( |
smq_varlabel |
( |
baskets |
( |
scopes |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADAE <- tmc_ex_adae .names_baskets <- grep("^(SMQ|CQ).*NAM$", names(ADAE), value = TRUE) .names_scopes <- grep("^SMQ.*SC$", names(ADAE), value = TRUE) .cs_baskets <- choices_selected( choices = variable_choices(ADAE, subset = .names_baskets), selected = .names_baskets ) .cs_scopes <- choices_selected( choices = variable_choices(ADAE, subset = .names_scopes), selected = .names_scopes, fixed = TRUE ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_t_smq( label = "Adverse Events by SMQ Table", dataname = "ADAE", arm_var = choices_selected( choices = variable_choices(data[["ADSL"]], subset = c("ARM", "SEX")), selected = "ARM" ), add_total = FALSE, baskets = data[[".cs_baskets"]], scopes = data[[".cs_scopes"]], llt = choices_selected( choices = variable_choices(data[["ADAE"]], subset = c("AEDECOD")), selected = "AEDECOD" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADAE <- tmc_ex_adae .names_baskets <- grep("^(SMQ|CQ).*NAM$", names(ADAE), value = TRUE) .names_scopes <- grep("^SMQ.*SC$", names(ADAE), value = TRUE) .cs_baskets <- choices_selected( choices = variable_choices(ADAE, subset = .names_baskets), selected = .names_baskets ) .cs_scopes <- choices_selected( choices = variable_choices(ADAE, subset = .names_scopes), selected = .names_scopes, fixed = TRUE ) }) join_keys(data) <- default_cdisc_join_keys[names(data)] app <- init( data = data, modules = modules( tm_t_smq( label = "Adverse Events by SMQ Table", dataname = "ADAE", arm_var = choices_selected( choices = variable_choices(data[["ADSL"]], subset = c("ARM", "SEX")), selected = "ARM" ), add_total = FALSE, baskets = data[[".cs_baskets"]], scopes = data[[".cs_scopes"]], llt = choices_selected( choices = variable_choices(data[["ADAE"]], subset = c("AEDECOD")), selected = "AEDECOD" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table to summarize variables.
tm_t_summary( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, summarize_vars, add_total = TRUE, total_label = default_total_label(), show_arm_var_labels = TRUE, useNA = c("ifany", "no"), na_level = default_na_str(), numeric_stats = c("n", "mean_sd", "mean_ci", "median", "median_ci", "quantiles", "range", "geom_mean"), denominator = c("N", "n", "omit"), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_summary( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, summarize_vars, add_total = TRUE, total_label = default_total_label(), show_arm_var_labels = TRUE, useNA = c("ifany", "no"), na_level = default_na_str(), numeric_stats = c("n", "mean_sd", "mean_ci", "median", "median_ci", "quantiles", "range", "geom_mean"), denominator = c("N", "n", "omit"), drop_arm_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
summarize_vars |
( |
add_total |
( |
total_label |
( |
show_arm_var_labels |
( |
useNA |
( |
na_level |
( |
numeric_stats |
( |
denominator |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
# Preparation of the test case - use `EOSDY` and `DCSREAS` variables to demonstrate missing data. data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADSL$EOSDY[1] <- NA_integer_ }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] app <- init( data = data, modules = modules( tm_t_summary( label = "Demographic Table", dataname = "ADSL", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), add_total = TRUE, summarize_vars = choices_selected( c("SEX", "RACE", "BMRKR2", "EOSDY", "DCSREAS", "AGE"), c("SEX", "RACE") ), useNA = "ifany" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
# Preparation of the test case - use `EOSDY` and `DCSREAS` variables to demonstrate missing data. data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADSL$EOSDY[1] <- NA_integer_ }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] app <- init( data = data, modules = modules( tm_t_summary( label = "Demographic Table", dataname = "ADSL", arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"), add_total = TRUE, summarize_vars = choices_selected( c("SEX", "RACE", "BMRKR2", "EOSDY", "DCSREAS", "AGE"), c("SEX", "RACE") ), useNA = "ifany" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a table to summarize variables by row groups.
tm_t_summary_by( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, by_vars, summarize_vars, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), paramcd = NULL, add_total = TRUE, total_label = default_total_label(), parallel_vars = FALSE, row_groups = FALSE, useNA = c("ifany", "no"), na_level = default_na_str(), numeric_stats = c("n", "mean_sd", "median", "range"), denominator = teal.transform::choices_selected(c("n", "N", "omit"), "omit", fixed = TRUE), drop_arm_levels = TRUE, drop_zero_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_summary_by( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, by_vars, summarize_vars, id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, subset = "USUBJID"), selected = "USUBJID", fixed = TRUE), paramcd = NULL, add_total = TRUE, total_label = default_total_label(), parallel_vars = FALSE, row_groups = FALSE, useNA = c("ifany", "no"), na_level = default_na_str(), numeric_stats = c("n", "mean_sd", "median", "range"), denominator = teal.transform::choices_selected(c("n", "N", "omit"), "omit", fixed = TRUE), drop_arm_levels = TRUE, drop_zero_levels = TRUE, pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
by_vars |
( |
summarize_vars |
( |
id_var |
( |
paramcd |
( |
add_total |
( |
total_label |
( |
parallel_vars |
( |
row_groups |
( |
useNA |
( |
na_level |
( |
numeric_stats |
( |
denominator |
( |
drop_arm_levels |
( |
drop_zero_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_summary_by( label = "Summary by Row Groups Table", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARM" ), add_total = TRUE, by_vars = choices_selected( choices = variable_choices(ADLB, c("PARAM", "AVISIT")), selected = c("AVISIT") ), summarize_vars = choices_selected( choices = variable_choices(ADLB, c("AVAL", "CHG")), selected = c("AVAL") ), useNA = "ifany", paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = "ALT" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADLB <- tmc_ex_adlb }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADLB <- data[["ADLB"]] app <- init( data = data, modules = modules( tm_t_summary_by( label = "Summary by Row Groups Table", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARM" ), add_total = TRUE, by_vars = choices_selected( choices = variable_choices(ADLB, c("PARAM", "AVISIT")), selected = c("AVISIT") ), summarize_vars = choices_selected( choices = variable_choices(ADLB, c("AVAL", "CHG")), selected = c("AVAL") ), useNA = "ifany", paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = "ALT" ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
This module produces a time-to-event analysis summary table, consistent with the TLG Catalog
template for TTET01
available here.
tm_t_tte( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, strata_var, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), conf_level_coxph = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), conf_level_survfit = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), time_points, time_unit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), event_desc_var = teal.transform::choices_selected("EVNTDESC", "EVNTDESC", fixed = TRUE), add_total = FALSE, total_label = default_total_label(), na_level = default_na_str(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
tm_t_tte( label, dataname, parentname = ifelse(inherits(arm_var, "data_extract_spec"), teal.transform::datanames_input(arm_var), "ADSL"), arm_var, arm_ref_comp = NULL, paramcd, strata_var, aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVAL"), "AVAL", fixed = TRUE), cnsr_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "CNSR"), "CNSR", fixed = TRUE), conf_level_coxph = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), conf_level_survfit = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order = TRUE), time_points, time_unit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname, "AVALU"), "AVALU", fixed = TRUE), event_desc_var = teal.transform::choices_selected("EVNTDESC", "EVNTDESC", fixed = TRUE), add_total = FALSE, total_label = default_total_label(), na_level = default_na_str(), pre_output = NULL, post_output = NULL, basic_table_args = teal.widgets::basic_table_args() )
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
arm_ref_comp |
( |
paramcd |
( |
strata_var |
( |
aval_var |
( |
cnsr_var |
( |
conf_level_coxph |
( |
conf_level_survfit |
( |
time_points |
( |
time_unit_var |
( |
event_desc_var |
( |
add_total |
( |
total_label |
( |
na_level |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
The core functionality of this module is based on coxph_pairwise()
, surv_timepoint()
, and surv_time()
from
the tern
package.
The arm and stratification variables are taken from the parentname
data.
The following variables are used in the module:
AVAL
: time to event
CNSR
: 1 if record in AVAL
is censored, 0 otherwise
PARAMCD
: variable used to filter for endpoint (e.g. OS). After
filtering for PARAMCD
one observation per patient is expected
a teal_module
object.
The TLG Catalog where additional example apps implementing this module can be found.
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) app <- init( data = data, modules = modules( tm_t_tte( label = "Time To Event Table", dataname = "ADTTE", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")), "ARM" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), strata_var = choices_selected( variable_choices(ADSL, c("SEX", "BMRKR2")), "SEX" ), time_points = choices_selected(c(182, 243), 182), event_desc_var = choices_selected( variable_choices(ADTTE, "EVNTDESC"), "EVNTDESC", fixed = TRUE ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }
data <- teal_data() data <- within(data, { ADSL <- tmc_ex_adsl ADTTE <- tmc_ex_adtte }) join_keys(data) <- default_cdisc_join_keys[names(data)] ADSL <- data[["ADSL"]] ADTTE <- data[["ADTTE"]] arm_ref_comp <- list( ACTARMCD = list( ref = "ARM B", comp = c("ARM A", "ARM C") ), ARM = list( ref = "B: Placebo", comp = c("A: Drug X", "C: Combination") ) ) app <- init( data = data, modules = modules( tm_t_tte( label = "Time To Event Table", dataname = "ADTTE", arm_var = choices_selected( variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")), "ARM" ), arm_ref_comp = arm_ref_comp, paramcd = choices_selected( value_choices(ADTTE, "PARAMCD", "PARAM"), "OS" ), strata_var = choices_selected( variable_choices(ADSL, c("SEX", "BMRKR2")), "SEX" ), time_points = choices_selected(c(182, 243), 182), event_desc_var = choices_selected( variable_choices(ADTTE, "EVNTDESC"), "EVNTDESC", fixed = TRUE ) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) }