diff --git a/man/tm_g_forest_tte.Rd b/man/tm_g_forest_tte.Rd index e69de29b..805009ba 100644 --- a/man/tm_g_forest_tte.Rd +++ b/man/tm_g_forest_tte.Rd @@ -0,0 +1,154 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/forestplot.R +\name{tm_g_forest_tte} +\alias{tm_g_forest_tte} +\alias{ui_g_forest_tte} +\alias{srv_g_forest_tte} +\alias{sample_tm_g_forest_tte} +\title{Teal Module for Survival Forest Plot} +\usage{ +tm_g_forest_tte( + label, + adtte_name, + mae_name, + adtte_vars = list(aval = "AVAL", is_event = "is_event", paramcd = "PARAMCD", usubjid = + "USUBJID", avalu = "AVALU"), + exclude_assays = "counts", + summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = + matrixStats::colMaxs), + pre_output = NULL, + post_output = NULL, + plot_height = c(600L, 200L, 2000L), + plot_width = c(1360L, 500L, 2000L), + .test = FALSE +) + +ui_g_forest_tte( + id, + adtte_name, + mae_name, + summary_funs, + pre_output, + post_output, + .test = FALSE +) + +srv_g_forest_tte( + id, + data, + filter_panel_api, + reporter, + adtte_name, + mae_name, + adtte_vars, + exclude_assays, + summary_funs, + plot_height, + plot_width, + .test = FALSE +) + +sample_tm_g_forest_tte(.test = FALSE) +} +\arguments{ +\item{label}{(\code{string})\cr +menu item label of the module in the teal app.} + +\item{adtte_name}{(\code{string})\cr +name of the \code{ADTTE} dataset.} + +\item{mae_name}{(\code{string})\cr +name of the MAE data used in the teal module.} + +\item{adtte_vars}{(named \code{list} of \code{string})\cr +names of the variables to use in the \code{ADTTE} dataset. It should comprise elements: +\itemize{ +\item \code{aval}: the numeric time-to-event variable. +\item \code{avalu}: the variable holding the unit of \code{aval}. +\item \code{is_event}: the logical event variable. It needs to be \code{TRUE} +when there was an observed event, and \code{FALSE} if the time is censored without +observed event. +\item \code{paramcd}: the character or factor parameter code variable, defining the +type of time-to-event for selection in the module. +\item \code{usubjid}: the subject ID variable. +}} + +\item{exclude_assays}{(\code{character})\cr +names of the assays which should not be included in choices in the teal module.} + +\item{summary_funs}{(named \code{list} of functions or \code{NULL})\cr functions which can be used +in the the gene signatures. For modules that support also multiple genes without +summary, \code{NULL} can be included to not summarize the genes but provide all of them.} + +\item{pre_output}{(\code{shiny.tag} or \code{NULL})\cr +placed before the output to put the output into context (for example a title).} + +\item{post_output}{(\code{shiny.tag} or \code{NULL})\cr +placed after the output to put the output into context (for example the \code{\link[shiny:helpText]{shiny::helpText()}} +elements can be useful).} + +\item{plot_height}{(\code{list})\cr list of integers to set the default, minimum, +and maximum plot height.} + +\item{plot_width}{(\code{list})\cr list of integers to set the default, minimum, +and maximum plot width.} + +\item{.test}{(\code{flag})\cr whether to display the internal structure of the plot for testing purposes.} + +\item{id}{(\code{string}) the shiny module id.} + +\item{data}{(\code{reactive})\cr +\verb{reactive()} holding all the data sets provided +during app initialization after going through the filters.} + +\item{filter_panel_api}{(\code{FilterPanelAPI})\cr object describing the actual filter panel API.} + +\item{reporter}{(\code{Reporter}) object} +} +\value{ +Shiny module to be used in the teal app. +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} + +This module provides an interactive survival forest plot. +} +\section{Functions}{ +\itemize{ +\item \code{ui_g_forest_tte()}: sets up the user interface. + +\item \code{srv_g_forest_tte()}: sets up the server with reactive graph. + +\item \code{sample_tm_g_forest_tte()}: sample module function. + +}} +\examples{ +data <- teal_data() +data <- within(data, { + ADTTE <- teal.modules.hermes::rADTTE \%>\% + dplyr::mutate(is_event = .data$CNSR == 0) + MAE <- hermes::multi_assay_experiment +}) +datanames <- c("ADTTE", "MAE") +datanames(data) <- datanames +teal.data::join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") + +app <- init( + data = data, + modules = modules( + tm_g_forest_tte( + label = "forestplot", + adtte_name = "ADTTE", + mae_name = "MAE" + ) + ) +) +if (interactive()) { + shinyApp(app$ui, app$server) +} + +# Alternatively you can run the sample module with this function call: +if (interactive()) { + sample_tm_g_forest_tte() +} +}