From 40d8f5c74999bfcaf9c7d2cfc738fe4150150420 Mon Sep 17 00:00:00 2001 From: vedhav Date: Fri, 14 Feb 2025 19:12:36 +0530 Subject: [PATCH 1/5] feat: remove "default" decoration and use the same way of decoration throughout --- R/tm_a_pca.R | 16 ++++----- R/tm_a_regression.R | 14 +++++++- R/tm_g_association.R | 14 +++++++- R/tm_g_bivariate.R | 14 +++++++- R/tm_g_distribution.R | 6 ++-- R/tm_g_response.R | 14 +++++++- R/tm_g_scatterplot.R | 14 +++++++- R/tm_g_scatterplotmatrix.R | 14 +++++++- R/tm_missing_data.R | 6 ++-- R/tm_outliers.R | 6 ++-- R/tm_t_crosstable.R | 13 +++++++- R/utils.R | 61 +++++++++-------------------------- man/normalize_decorators.Rd | 18 ----------- man/select_decorators.Rd | 5 ++- man/tm_a_pca.Rd | 16 ++++----- man/tm_a_regression.Rd | 14 +++++++- man/tm_data_table.Rd | 2 +- man/tm_front_page.Rd | 2 +- man/tm_g_association.Rd | 14 +++++++- man/tm_g_bivariate.Rd | 14 +++++++- man/tm_g_distribution.Rd | 7 ++-- man/tm_g_response.Rd | 14 +++++++- man/tm_g_scatterplot.Rd | 14 +++++++- man/tm_g_scatterplotmatrix.Rd | 14 +++++++- man/tm_missing_data.Rd | 7 ++-- man/tm_outliers.Rd | 7 ++-- man/tm_t_crosstable.Rd | 14 +++++++- man/tm_variable_browser.Rd | 2 +- 28 files changed, 230 insertions(+), 126 deletions(-) delete mode 100644 man/normalize_decorators.Rd diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index fe8b3d398..ed13916f5 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -25,20 +25,18 @@ #' - `biplot` (`ggplot2`) #' - `eigenvector_plot` (`ggplot2`) #' -#' Decorators can be applied to all outputs or only to specific objects using a -#' named list of `teal_transform_module` objects. -#' The `"default"` name is reserved for decorators that are applied to all outputs. +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. #' See code snippet below: #' #' ``` #' tm_a_pca( #' ..., # arguments for module #' decorators = list( -#' default = list(teal_transform_module(...)), # applied to all outputs -#' elbow_plot = list(teal_transform_module(...)), # applied only to `elbow_plot` output -#' circle_plot = list(teal_transform_module(...)) # applied only to `circle_plot` output -#' biplot = list(teal_transform_module(...)) # applied only to `biplot` output -#' eigenvector_plot = list(teal_transform_module(...)) # applied only to `eigenvector_plot` output +#' elbow_plot = teal_transform_module(...), # applied to the `elbow_plot` output +#' circle_plot = teal_transform_module(...), # applied to the `circle_plot` output +#' biplot = teal_transform_module(...), # applied to the `biplot` output +#' eigenvector_plot = teal_transform_module(...) # applied to the `eigenvector_plot` output #' ) #' ) #' ``` @@ -186,9 +184,7 @@ tm_a_pca <- function(label = "Principal Component Analysis", checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) available_decorators <- c("elbow_plot", "circle_plot", "biplot", "eigenvector_plot") - decorators <- normalize_decorators(decorators) assert_decorators(decorators, available_decorators) - # End of assertions # Make UI args args <- as.list(environment()) diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index 0b5246941..bd976690a 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -48,6 +48,19 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `plot` (`ggplot2`) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_a_regression( +#' ..., # arguments for module +#' decorators = list( +#' plot = teal_transform_module(...) # applied to the `plot` output +#' ) +#' ) +#' ``` +#' #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -225,7 +238,6 @@ tm_a_regression <- function(label = "Regression Analysis", .var.name = "label_segment_threshold" ) } - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/tm_g_association.R b/R/tm_g_association.R index b2f3a7141..b14a2ba34 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -29,6 +29,19 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `plot` (`grob` created with [ggplot2::ggplotGrob()]) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_g_association( +#' ..., # arguments for module +#' decorators = list( +#' plot = teal_transform_module(...) # applied to the `plot` output +#' ) +#' ) +#' ``` +#' #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -176,7 +189,6 @@ tm_g_association <- function(label = "Association", checkmate::assert_list(ggplot2_args, types = "ggplot2_args") checkmate::assert_subset(names(ggplot2_args), c("default", plot_choices)) - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index adc4e9c0f..14fec9e90 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -51,6 +51,19 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `plot` (`ggplot2`) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_g_bivariate( +#' ..., # arguments for module +#' decorators = list( +#' plot = teal_transform_module(...) # applied to the `plot` output +#' ) +#' ) +#' ``` +#' #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -277,7 +290,6 @@ tm_g_bivariate <- function(label = "Bivariate Plots", checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 9e8319302..297480999 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -34,9 +34,8 @@ #' - `summary_table` (`listing_df` created with [rlistings::as_listing()]) #' - `test_table` (`listing_df` created with [rlistings::as_listing()]) #' -#' Decorators can be applied to all outputs or only to specific objects using a -#' named list of `teal_transform_module` objects. -#' The `"default"` name is reserved for decorators that are applied to all outputs. +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. #' See code snippet below: #' #' ``` @@ -194,7 +193,6 @@ tm_g_distribution <- function(label = "Distribution Module", checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) available_decorators <- c("histogram_plot", "qq_plot", "test_table", "summary_table") - decorators <- normalize_decorators(decorators) assert_decorators(decorators, names = available_decorators) # End of assertions diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 85d337653..8c110f31b 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -44,6 +44,19 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `plot` (`ggplot2`) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_g_response( +#' ..., # arguments for module +#' decorators = list( +#' plot = teal_transform_module(...) # applied to the `plot` output +#' ) +#' ) +#' ``` +#' #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -202,7 +215,6 @@ tm_g_response <- function(label = "Response Plot", checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index 45b411dda..1983552de 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -35,6 +35,19 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `plot` (`ggplot2`) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_g_scatterplot( +#' ..., # arguments for module +#' decorators = list( +#' plot = teal_transform_module(...) # applied to the `plot` output +#' ) +#' ) +#' ``` +#' #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -299,7 +312,6 @@ tm_g_scatterplot <- function(label = "Scatterplot", checkmate::assert_scalar(table_dec) checkmate::assert_class(ggplot2_args, "ggplot2_args") - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index cd8b8c84c..4d289eb47 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -23,6 +23,19 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `plot` (`trellis` - output of `lattice::splom`) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_g_scatterplotmatrix( +#' ..., # arguments for module +#' decorators = list( +#' plot = teal_transform_module(...) # applied to the `plot` output +#' ) +#' ) +#' ``` +#' #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -199,7 +212,6 @@ tm_g_scatterplotmatrix <- function(label = "Scatterplot Matrix", checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 06ca7466a..561e7d65c 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -25,9 +25,8 @@ #' - `by_subject_plot` (`ggplot2`) #' - `table` (`listing_df` created with [rlistings::as_listing()]) #' -#' Decorators can be applied to all outputs or only to specific objects using a -#' named list of `teal_transform_module` objects. -#' The `"default"` name is reserved for decorators that are applied to all outputs. +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. #' See code snippet below: #' #' ``` @@ -148,7 +147,6 @@ tm_missing_data <- function(label = "Missing data", checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) available_decorators <- c("summary_plot", "combination_plot", "by_subject_plot", "summary_table") - decorators <- normalize_decorators(decorators) assert_decorators(decorators, names = available_decorators) # End of assertions diff --git a/R/tm_outliers.R b/R/tm_outliers.R index af9f91abe..74accfcf1 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -23,9 +23,8 @@ #' - `cumulative_plot` (`ggplot2`) #' - `table` (`listing_df` created with [rlistings::as_listing()]) #' -#' Decorators can be applied to all outputs or only to specific objects using a -#' named list of `teal_transform_module` objects. -#' The `"default"` name is reserved for decorators that are applied to all outputs. +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. #' See code snippet below: #' #' ``` @@ -197,7 +196,6 @@ tm_outliers <- function(label = "Outliers Module", checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) available_decorators <- c("box_plot", "density_plot", "cumulative_plot", "table") - decorators <- normalize_decorators(decorators) assert_decorators(decorators, names = available_decorators) # End of assertions diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 2286a70f7..e356ba200 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -30,6 +30,18 @@ #' This module generates the following objects, which can be modified in place using decorators: #' - `table` (`ElementaryTable` - output of `rtables::build_table`) #' +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. +#' The name of this list corresponds to the name of the output to which the decorator is applied. +#' See code snippet below: +#' +#' ``` +#' tm_g_scatterplotmatrix( +#' ..., # arguments for module +#' decorators = list( +#' table = teal_transform_module(...) # applied to the `table` output +#' ) +#' ) +#' ``` #' For additional details and examples of decorators, refer to the vignette #' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation. #' @@ -164,7 +176,6 @@ tm_t_crosstable <- function(label = "Cross Table", checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) checkmate::assert_class(basic_table_args, classes = "basic_table_args") - decorators <- normalize_decorators(decorators) assert_decorators(decorators, "plot") # End of assertions diff --git a/R/utils.R b/R/utils.R index 1166de42e..50d747f6c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -347,24 +347,18 @@ check_decorators <- function(x, names = NULL) { # nolint: object_name. check_message <- checkmate::check_list(x, names = "named") if (!is.null(names)) { - check_message <- if (isTRUE(check_message)) { - out_message <- checkmate::check_names(names(x), subset.of = c("default", names)) - # see https://github.com/insightsengineering/teal.logger/issues/101 + if (isTRUE(check_message)) { if (length(names(x)) != length(unique(names(x)))) { - unique_message <- "Non-unique names in decorators" - if (isTRUE(out_message)) { - out_message <- unique_message - } else { - out_message <- paste0(out_message, ". Also, ", tolower(unique_message)) - } - } - if (isTRUE(out_message)) { - out_message - } else { - gsub("\\{", "(", gsub("\\}", ")", out_message)) + check_message <- sprintf( + "The `decorators` must contain unique names from these names: %s.", + paste(names, collapse = ", ") + ) } } else { - check_message + check_message <- sprintf( + "The `decorators` must be a named list from these names: %s.", + paste(names, collapse = ", ") + ) } } @@ -374,8 +368,8 @@ check_decorators <- function(x, names = NULL) { # nolint: object_name. valid_elements <- vapply( x, - checkmate::test_list, - types = "teal_transform_module", + checkmate::test_class, + classes = "teal_transform_module", FUN.VALUE = logical(1L) ) @@ -383,48 +377,25 @@ check_decorators <- function(x, names = NULL) { # nolint: object_name. return(TRUE) } - "May only contain the type 'teal_transform_module' or a named list of 'teal_transform_module'." + "Make sure that the named list contains 'teal_transform_module' objects created using `teal_transform_module()`." } - #' Internal assertion on decorators #' @noRd assert_decorators <- checkmate::makeAssertionFunction(check_decorators) #' Subset decorators based on the scope #' -#' `default` is a protected decorator name that is always included in the output, -#' if it exists -#' #' @param scope (`character`) a character vector of decorator names to include. #' @param decorators (named `list`) of list decorators to subset. #' -#' @return A flat list with all decorators to include. +#' @return Subsetted list with all decorators to include. #' It can be an empty list if none of the scope exists in `decorators` argument. #' @keywords internal select_decorators <- function(decorators, scope) { checkmate::assert_character(scope, null.ok = TRUE) - scope <- intersect(union("default", scope), names(decorators)) - c(list(), unlist(decorators[scope], recursive = FALSE)) -} - -#' Convert flat list of `teal_transform_module` to named lists -#' -#' @param decorators (list of `teal_transform_module`) to normalize. -#' @return A named list of lists with `teal_transform_module` objects. -#' @keywords internal -normalize_decorators <- function(decorators) { - if (checkmate::test_list(decorators, "teal_transform_module")) { - decorators_names <- names(decorators)[!names(decorators) %in% ""] - # Above is equivalent to decorators_names <- setdiff(names(decorators), "") - # but can return non-unique values. Non-unique values are checked in assert_decorators. - if (length(decorators_names) == 0) { - list(default = decorators) - } else if (length(decorators_names) == length(decorators)) { - lapply(decorators, list) - } else { - stop("All decorators should either be named or unnamed.") - } + if (scope %in% names(decorators)) { + decorators[scope] } else { - decorators + list() } } diff --git a/man/normalize_decorators.Rd b/man/normalize_decorators.Rd deleted file mode 100644 index 257342765..000000000 --- a/man/normalize_decorators.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{normalize_decorators} -\alias{normalize_decorators} -\title{Convert flat list of \code{teal_transform_module} to named lists} -\usage{ -normalize_decorators(decorators) -} -\arguments{ -\item{decorators}{(list of \code{teal_transform_module}) to normalize.} -} -\value{ -A named list of lists with \code{teal_transform_module} objects. -} -\description{ -Convert flat list of \code{teal_transform_module} to named lists -} -\keyword{internal} diff --git a/man/select_decorators.Rd b/man/select_decorators.Rd index 2c7403dca..bf004d541 100644 --- a/man/select_decorators.Rd +++ b/man/select_decorators.Rd @@ -12,11 +12,10 @@ select_decorators(decorators, scope) \item{scope}{(\code{character}) a character vector of decorator names to include.} } \value{ -A flat list with all decorators to include. +Subsetted list with all decorators to include. It can be an empty list if none of the scope exists in \code{decorators} argument. } \description{ -\code{default} is a protected decorator name that is always included in the output, -if it exists +Subset decorators based on the scope } \keyword{internal} diff --git a/man/tm_a_pca.Rd b/man/tm_a_pca.Rd index 6c6ed464c..b65ba4b0e 100644 --- a/man/tm_a_pca.Rd +++ b/man/tm_a_pca.Rd @@ -74,7 +74,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -105,19 +105,17 @@ This module generates the following objects, which can be modified in place usin \item \code{eigenvector_plot} (\code{ggplot2}) } -Decorators can be applied to all outputs or only to specific objects using a -named list of \code{teal_transform_module} objects. -The \code{"default"} name is reserved for decorators that are applied to all outputs. +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. See code snippet below: \if{html}{\out{
}}\preformatted{tm_a_pca( ..., # arguments for module decorators = list( - default = list(teal_transform_module(...)), # applied to all outputs - elbow_plot = list(teal_transform_module(...)), # applied only to `elbow_plot` output - circle_plot = list(teal_transform_module(...)) # applied only to `circle_plot` output - biplot = list(teal_transform_module(...)) # applied only to `biplot` output - eigenvector_plot = list(teal_transform_module(...)) # applied only to `eigenvector_plot` output + elbow_plot = teal_transform_module(...), # applied to the `elbow_plot` output + circle_plot = teal_transform_module(...), # applied to the `circle_plot` output + biplot = teal_transform_module(...), # applied to the `biplot` output + eigenvector_plot = teal_transform_module(...) # applied to the `eigenvector_plot` output ) ) }\if{html}{\out{
}} diff --git a/man/tm_a_regression.Rd b/man/tm_a_regression.Rd index 7b419ad07..1a2c9cda3 100644 --- a/man/tm_a_regression.Rd +++ b/man/tm_a_regression.Rd @@ -98,7 +98,7 @@ argument in \code{teal.widgets::optionalSliderInputValMinMax}. }} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -130,6 +130,18 @@ This module generates the following objects, which can be modified in place usin \item \code{plot} (\code{ggplot2}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_a_regression( + ..., # arguments for module + decorators = list( + plot = teal_transform_module(...) # applied to the `plot` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index f013fd316..e5084fbf8 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -57,7 +57,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} } \value{ Object of class \code{teal_module} to be used in \code{teal} applications. diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 4ea5c0bfd..36a288b5a 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -46,7 +46,7 @@ argument. }} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} } \value{ Object of class \code{teal_module} to be used in \code{teal} applications. diff --git a/man/tm_g_association.Rd b/man/tm_g_association.Rd index 63b819f8e..5803509b4 100644 --- a/man/tm_g_association.Rd +++ b/man/tm_g_association.Rd @@ -59,7 +59,7 @@ List names should match the following: \code{c("default", "Bivariate1", "Bivaria For more details see the vignette: \code{vignette("custom-ggplot2-arguments", package = "teal.widgets")}.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -90,6 +90,18 @@ This module generates the following objects, which can be modified in place usin \item \code{plot} (\code{grob} created with \code{\link[ggplot2:ggplotGrob]{ggplot2::ggplotGrob()}}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_g_association( + ..., # arguments for module + decorators = list( + plot = teal_transform_module(...) # applied to the `plot` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_g_bivariate.Rd b/man/tm_g_bivariate.Rd index 8f65e787e..b20333141 100644 --- a/man/tm_g_bivariate.Rd +++ b/man/tm_g_bivariate.Rd @@ -104,7 +104,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -137,6 +137,18 @@ This module generates the following objects, which can be modified in place usin \item \code{plot} (\code{ggplot2}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_g_bivariate( + ..., # arguments for module + decorators = list( + plot = teal_transform_module(...) # applied to the `plot` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index 81c33fe0d..4ae58f681 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -66,7 +66,7 @@ with text placed before the output to put the output into context. For example a into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -96,9 +96,8 @@ This module generates the following objects, which can be modified in place usin \item \code{test_table} (\code{listing_df} created with \code{\link[rlistings:listings]{rlistings::as_listing()}}) } -Decorators can be applied to all outputs or only to specific objects using a -named list of \code{teal_transform_module} objects. -The \code{"default"} name is reserved for decorators that are applied to all outputs. +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. See code snippet below: \if{html}{\out{
}}\preformatted{tm_g_distribution( diff --git a/man/tm_g_response.Rd b/man/tm_g_response.Rd index cba0cb8ae..1e3afce5f 100644 --- a/man/tm_g_response.Rd +++ b/man/tm_g_response.Rd @@ -84,7 +84,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -118,6 +118,18 @@ This module generates the following objects, which can be modified in place usin \item \code{plot} (\code{ggplot2}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_g_response( + ..., # arguments for module + decorators = list( + plot = teal_transform_module(...) # applied to the `plot` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_g_scatterplot.Rd b/man/tm_g_scatterplot.Rd index 5718948fc..e757ca54b 100644 --- a/man/tm_g_scatterplot.Rd +++ b/man/tm_g_scatterplot.Rd @@ -97,7 +97,7 @@ The argument is merged with options variable \code{teal.ggplot2_args} and defaul For more details see the vignette: \code{vignette("custom-ggplot2-arguments", package = "teal.widgets")}} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -129,6 +129,18 @@ This module generates the following objects, which can be modified in place usin \item \code{plot} (\code{ggplot2}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_g_scatterplot( + ..., # arguments for module + decorators = list( + plot = teal_transform_module(...) # applied to the `plot` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_g_scatterplotmatrix.Rd b/man/tm_g_scatterplotmatrix.Rd index 751a59c57..9bd448f7d 100644 --- a/man/tm_g_scatterplotmatrix.Rd +++ b/man/tm_g_scatterplotmatrix.Rd @@ -38,7 +38,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -69,6 +69,18 @@ This module generates the following objects, which can be modified in place usin \item \code{plot} (\code{trellis} - output of \code{lattice::splom}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_g_scatterplotmatrix( + ..., # arguments for module + decorators = list( + plot = teal_transform_module(...) # applied to the `plot` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index 4bba85c17..c13fc5c73 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -59,7 +59,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -90,9 +90,8 @@ This module generates the following objects, which can be modified in place usin \item \code{table} (\code{listing_df} created with \code{\link[rlistings:listings]{rlistings::as_listing()}}) } -Decorators can be applied to all outputs or only to specific objects using a -named list of \code{teal_transform_module} objects. -The \code{"default"} name is reserved for decorators that are applied to all outputs. +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. See code snippet below: \if{html}{\out{
}}\preformatted{tm_missing_data( diff --git a/man/tm_outliers.Rd b/man/tm_outliers.Rd index 6f60a48ed..c2076aad6 100644 --- a/man/tm_outliers.Rd +++ b/man/tm_outliers.Rd @@ -50,7 +50,7 @@ with text placed before the output to put the output into context. For example a adding context or further instructions. Elements like \code{shiny::helpText()} are useful.} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -80,9 +80,8 @@ This module generates the following objects, which can be modified in place usin \item \code{table} (\code{listing_df} created with \code{\link[rlistings:listings]{rlistings::as_listing()}}) } -Decorators can be applied to all outputs or only to specific objects using a -named list of \code{teal_transform_module} objects. -The \code{"default"} name is reserved for decorators that are applied to all outputs. +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. See code snippet below: \if{html}{\out{
}}\preformatted{tm_outliers( diff --git a/man/tm_t_crosstable.Rd b/man/tm_t_crosstable.Rd index c4452a313..224ab1fb7 100644 --- a/man/tm_t_crosstable.Rd +++ b/man/tm_t_crosstable.Rd @@ -53,7 +53,7 @@ The argument is merged with options variable \code{teal.basic_table_args} and de For more details see the vignette: \code{vignette("custom-basic-table-arguments", package = "teal.widgets")}} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -83,6 +83,18 @@ This module generates the following objects, which can be modified in place usin \item \code{table} (\code{ElementaryTable} - output of \code{rtables::build_table}) } +A Decorator is applied to the specific output using a named list of \code{teal_transform_module} objects. +The name of this list corresponds to the name of the output to which the decorator is applied. +See code snippet below: + +\if{html}{\out{
}}\preformatted{tm_g_scatterplotmatrix( + ..., # arguments for module + decorators = list( + table = teal_transform_module(...) # applied to the `table` output + ) +) +}\if{html}{\out{
}} + For additional details and examples of decorators, refer to the vignette \code{vignette("decorate-modules-output", package = "teal")} or the \code{\link[teal:teal_transform_module]{teal::teal_transform_module()}} documentation. } diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index d2f271e60..9f439c157 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -51,7 +51,7 @@ The argument is merged with options variable \code{teal.ggplot2_args} and defaul For more details see the vignette: \code{vignette("custom-ggplot2-arguments", package = "teal.widgets")}} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} } \value{ Object of class \code{teal_module} to be used in \code{teal} applications. From 0b704baebcb14d6f19db0ee50c0521067803dacd Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 17 Feb 2025 11:31:58 +0100 Subject: [PATCH 2/5] typos in crosstable --- R/tm_t_crosstable.R | 8 ++++---- man/tm_t_crosstable.Rd | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index e356ba200..842b36c25 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -35,7 +35,7 @@ #' See code snippet below: #' #' ``` -#' tm_g_scatterplotmatrix( +#' tm_g_crosstable( #' ..., # arguments for module #' decorators = list( #' table = teal_transform_module(...) # applied to the `table` output @@ -176,7 +176,7 @@ tm_t_crosstable <- function(label = "Cross Table", checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) checkmate::assert_class(basic_table_args, classes = "basic_table_args") - assert_decorators(decorators, "plot") + assert_decorators(decorators, "table") # End of assertions # Make UI args @@ -244,7 +244,7 @@ ui_t_crosstable <- function(id, x, y, show_percentage, show_total, pre_output, p checkboxInput(ns("show_total"), "Show total column", value = show_total) ) ), - ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")) + ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "table")) ), forms = tagList( teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") @@ -420,7 +420,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, decorated_output_q <- srv_decorate_teal_data( id = "decorator", data = output_q, - decorators = select_decorators(decorators, "plot"), + decorators = select_decorators(decorators, "table"), expr = table ) diff --git a/man/tm_t_crosstable.Rd b/man/tm_t_crosstable.Rd index 224ab1fb7..95aeca903 100644 --- a/man/tm_t_crosstable.Rd +++ b/man/tm_t_crosstable.Rd @@ -53,7 +53,7 @@ The argument is merged with options variable \code{teal.basic_table_args} and de For more details see the vignette: \code{vignette("custom-basic-table-arguments", package = "teal.widgets")}} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("transform-input-data", package = "teal")}.} +To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -87,7 +87,7 @@ A Decorator is applied to the specific output using a named list of \code{teal_t The name of this list corresponds to the name of the output to which the decorator is applied. See code snippet below: -\if{html}{\out{
}}\preformatted{tm_g_scatterplotmatrix( +\if{html}{\out{
}}\preformatted{tm_g_crosstable( ..., # arguments for module decorators = list( table = teal_transform_module(...) # applied to the `table` output @@ -195,13 +195,13 @@ if (interactive()) { \describe{ \item{example-1}{ \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6ujCkBCyicVU1dRWmRIy67Fq6KroE7AqErNQDpQNaoiO6A7CTA1IsA3K25RCVldW1jKLAwFoAunsNUOIm6qRt7Bt1O-t7iqu6AL4tV1s7A6iMtDAsrIkA1nBWAMDg1RHAAI6JEQQdgQRhEbKXJpbJZKR73ABWRBUAKBomKGVsWWxuMBrAJpIgeI4A1eEzwUzA9NmYE+31+NMW9yUaFQDRUeX6DxSugAvP4MrgXgJhGJxVVZSICS1KqQYIlSIkCAjRKIgvQRMK1mtqFB6HA-BKBgBhXX1OzmqJ4VVrUIKlKJMKkZgaRKiVBwPquk0paDwBV0lEM6UPE2VcEiDQKxNBrUBoPG+Mms0Wq1MgDKlrTui0LFoTrgiBGIfjBHyOII8olZa+le1DdoTYJKXezOjIL2pWDg2GjLGMaZM3HYHmjG5sezJtTGjg-AVI4IQ1Zc8Wi6X62EmkieglDhc+4PbX4MjXCvPzkvS5MtFCd4lADEAIIAGQLrjjeN7mzOQn0qVgPQyL1Qh9M5-UDYNANDDJw1PJkWRdJC1hXUgU2LP0M0Qg9KlzS1IzAIsk1w1sK0NKsaywk160bZtS3LdtmK7MRCSCPsMIOYd+lHVlxlZadRlnOAFjAJYwPjHD3yZUTMOIqoj1oE8FW-P9H1rE0XzfddP1-f89N0YCgNdCz7nuWgTA6FRyF9TQdBsZYWlEQoIFYL90HYPkABJBFoUpAvBRgdEYe5nggMBHj2IA}{Open in Shinylive} - \if{html}{\out{}} - \if{html}{\out{}} + \if{html}{\out{}} + \if{html}{\out{}} } \item{example-2}{ \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXQBBHwCAGWTdVIxMxERGRpalAF9FCAArIhU0gGs4VlEK3Nt8-jgTKGFSNIJ+WlECNLGJ6dngaHg5zLkAXTdodDaVYvZakNzdAF4X8NxnviERUXeul+wjETwgdTqpBgaQ2BEYRFEonC9BEYIhEOoUHocGogIUYC88MR9ix8Twz3RUUBmTS0VIzA0aVEqDgBDR6IhmVOeg++L6zXx33BHLqohxrNIgLFIkZzNZ7JFdUx2NxvLAAXFGl0WhYtFJcEQgopioIJXGBDEgJ1jD1KLgmzNtAt51ywGAfKaArAl0uVVEgnoYslHzMFk01gu1WNit0tH4VPyAEIdehqBxKrGICUZMVRFVqEQJE7uOwAIxyKps-E+MJwQW6fEABQA8gE-AANDT1putjvUUj4uTDGPoxhwUiCRgQdjcl3hOTAONRS7DkdDIUj3TSiVwfh4gnNxwAOQcAE0jcKYzB1rQ4jz7E5nBuR0RGMsx3uPg4XM+YyZaFEu6AgAYvUzQBK4l4cqu6IVtGuisNSuS0lE9LqBscpVlB6JcrA94ev05LYRC25ah8pEYSyWGbsqOL7hqMqStatoiIaRGbqa5qWh8zH6g6XFzlAboEV6Pp+gGQaAqGlgRgsUbESKS5tCmcTprkVQ7BgqwaK++aFsW1BlkO8EimOE5TjOeGCQuS4riZELrvZoqauQn4Nuqzjthem7Xv2t4iCBYEQb+ir-oBbmgeBkExjBEKxauwzDLQJi6OwKjkAymg6DYtg1MKohlBArD1Og7BoKgAAkgi0FU5UVWKjA6IwwwDEoYADJcQA}{Open in Shinylive} - \if{html}{\out{}} - \if{html}{\out{}} + \if{html}{\out{}} + \if{html}{\out{}} } } } From ab09c50b09434bf15c86ba3fe4d015194b1e54b6 Mon Sep 17 00:00:00 2001 From: vedhav Date: Mon, 17 Feb 2025 16:04:50 +0530 Subject: [PATCH 3/5] chore: remove default --- R/tm_g_distribution.R | 5 ++--- R/tm_missing_data.R | 5 ++--- R/tm_outliers.R | 5 ++--- R/tm_t_crosstable.R | 2 +- man/tm_g_distribution.Rd | 5 ++--- man/tm_missing_data.Rd | 5 ++--- man/tm_outliers.Rd | 5 ++--- man/tm_t_crosstable.Rd | 2 +- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 297480999..b3cebb041 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -42,10 +42,9 @@ #' tm_g_distribution( #' ..., # arguments for module #' decorators = list( -#' default = list(teal_transform_module(...)), # applied to all outputs #' histogram_plot = list(teal_transform_module(...)), # applied only to `histogram_plot` output -#' qq_plot = list(teal_transform_module(...)) # applied only to `qq_plot` output -#' summary_table = list(teal_transform_module(...)) # applied only to `summary_table` output +#' qq_plot = list(teal_transform_module(...)), # applied only to `qq_plot` output +#' summary_table = list(teal_transform_module(...)), # applied only to `summary_table` output #' test_table = list(teal_transform_module(...)) # applied only to `test_table` output #' ) #' ) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 561e7d65c..96578be25 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -33,10 +33,9 @@ #' tm_missing_data( #' ..., # arguments for module #' decorators = list( -#' default = list(teal_transform_module(...)), # applied to all outputs #' summary_plot = list(teal_transform_module(...)), # applied only to `summary_plot` output -#' combination_plot = list(teal_transform_module(...)) # applied only to `combination_plot` output -#' by_subject_plot = list(teal_transform_module(...)) # applied only to `by_subject_plot` output +#' combination_plot = list(teal_transform_module(...)), # applied only to `combination_plot` output +#' by_subject_plot = list(teal_transform_module(...)), # applied only to `by_subject_plot` output #' table = list(teal_transform_module(...)) # applied only to `table` output #' ) #' ) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 74accfcf1..53d9e21b6 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -31,10 +31,9 @@ #' tm_outliers( #' ..., # arguments for module #' decorators = list( -#' default = list(teal_transform_module(...)), # applied to all outputs #' box_plot = list(teal_transform_module(...)), # applied only to `box_plot` output -#' density_plot = list(teal_transform_module(...)) # applied only to `density_plot` output -#' cumulative_plot = list(teal_transform_module(...)) # applied only to `cumulative_plot` output +#' density_plot = list(teal_transform_module(...)), # applied only to `density_plot` output +#' cumulative_plot = list(teal_transform_module(...)), # applied only to `cumulative_plot` output #' table = list(teal_transform_module(...)) # applied only to `table` output #' ) #' ) diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 842b36c25..f251ec31e 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -35,7 +35,7 @@ #' See code snippet below: #' #' ``` -#' tm_g_crosstable( +#' tm_t_crosstable( #' ..., # arguments for module #' decorators = list( #' table = teal_transform_module(...) # applied to the `table` output diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index 4ae58f681..7220d2de5 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -103,10 +103,9 @@ See code snippet below: \if{html}{\out{
}}\preformatted{tm_g_distribution( ..., # arguments for module decorators = list( - default = list(teal_transform_module(...)), # applied to all outputs histogram_plot = list(teal_transform_module(...)), # applied only to `histogram_plot` output - qq_plot = list(teal_transform_module(...)) # applied only to `qq_plot` output - summary_table = list(teal_transform_module(...)) # applied only to `summary_table` output + qq_plot = list(teal_transform_module(...)), # applied only to `qq_plot` output + summary_table = list(teal_transform_module(...)), # applied only to `summary_table` output test_table = list(teal_transform_module(...)) # applied only to `test_table` output ) ) diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index c13fc5c73..cea6fe94e 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -97,10 +97,9 @@ See code snippet below: \if{html}{\out{
}}\preformatted{tm_missing_data( ..., # arguments for module decorators = list( - default = list(teal_transform_module(...)), # applied to all outputs summary_plot = list(teal_transform_module(...)), # applied only to `summary_plot` output - combination_plot = list(teal_transform_module(...)) # applied only to `combination_plot` output - by_subject_plot = list(teal_transform_module(...)) # applied only to `by_subject_plot` output + combination_plot = list(teal_transform_module(...)), # applied only to `combination_plot` output + by_subject_plot = list(teal_transform_module(...)), # applied only to `by_subject_plot` output table = list(teal_transform_module(...)) # applied only to `table` output ) ) diff --git a/man/tm_outliers.Rd b/man/tm_outliers.Rd index c2076aad6..4dedf1bd0 100644 --- a/man/tm_outliers.Rd +++ b/man/tm_outliers.Rd @@ -87,10 +87,9 @@ See code snippet below: \if{html}{\out{
}}\preformatted{tm_outliers( ..., # arguments for module decorators = list( - default = list(teal_transform_module(...)), # applied to all outputs box_plot = list(teal_transform_module(...)), # applied only to `box_plot` output - density_plot = list(teal_transform_module(...)) # applied only to `density_plot` output - cumulative_plot = list(teal_transform_module(...)) # applied only to `cumulative_plot` output + density_plot = list(teal_transform_module(...)), # applied only to `density_plot` output + cumulative_plot = list(teal_transform_module(...)), # applied only to `cumulative_plot` output table = list(teal_transform_module(...)) # applied only to `table` output ) ) diff --git a/man/tm_t_crosstable.Rd b/man/tm_t_crosstable.Rd index 95aeca903..195c57faa 100644 --- a/man/tm_t_crosstable.Rd +++ b/man/tm_t_crosstable.Rd @@ -87,7 +87,7 @@ A Decorator is applied to the specific output using a named list of \code{teal_t The name of this list corresponds to the name of the output to which the decorator is applied. See code snippet below: -\if{html}{\out{
}}\preformatted{tm_g_crosstable( +\if{html}{\out{
}}\preformatted{tm_t_crosstable( ..., # arguments for module decorators = list( table = teal_transform_module(...) # applied to the `table` output From 849c8590fd17ba8ec052d2552e245b1fa5a250f1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:38:38 +0000 Subject: [PATCH 4/5] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_t_crosstable.Rd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man/tm_t_crosstable.Rd b/man/tm_t_crosstable.Rd index 195c57faa..7bbc7e6f7 100644 --- a/man/tm_t_crosstable.Rd +++ b/man/tm_t_crosstable.Rd @@ -53,7 +53,7 @@ The argument is merged with options variable \code{teal.basic_table_args} and de For more details see the vignette: \code{vignette("custom-basic-table-arguments", package = "teal.widgets")}} \item{transformators}{(\code{list} of \code{teal_transform_module}) that will be applied to transform module's data input. -To learn more check \code{vignette("data-transform-as-shiny-module", package = "teal")}.} +To learn more check \code{vignette("transform-input-data", package = "teal")}.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} (\code{list} of \code{teal_transform_module}, named \code{list} of \code{teal_transform_module}) optional, @@ -195,13 +195,13 @@ if (interactive()) { \describe{ \item{example-1}{ \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6ujCkBCyicVU1dRWmRIy67Fq6KroE7AqErNQDpQNaoiO6A7CTA1IsA3K25RCVldW1jKLAwFoAunsNUOIm6qRt7Bt1O-t7iqu6AL4tV1s7A6iMtDAsrIkA1nBWAMDg1RHAAI6JEQQdgQRhEbKXJpbJZKR73ABWRBUAKBomKGVsWWxuMBrAJpIgeI4A1eEzwUzA9NmYE+31+NMW9yUaFQDRUeX6DxSugAvP4MrgXgJhGJxVVZSICS1KqQYIlSIkCAjRKIgvQRMK1mtqFB6HA-BKBgBhXX1OzmqJ4VVrUIKlKJMKkZgaRKiVBwPquk0paDwBV0lEM6UPE2VcEiDQKxNBrUBoPG+Mms0Wq1MgDKlrTui0LFoTrgiBGIfjBHyOII8olZa+le1DdoTYJKXezOjIL2pWDg2GjLGMaZM3HYHmjG5sezJtTGjg-AVI4IQ1Zc8Wi6X62EmkieglDhc+4PbX4MjXCvPzkvS5MtFCd4lADEAIIAGQLrjjeN7mzOQn0qVgPQyL1Qh9M5-UDYNANDDJw1PJkWRdJC1hXUgU2LP0M0Qg9KlzS1IzAIsk1w1sK0NKsaywk160bZtS3LdtmK7MRCSCPsMIOYd+lHVlxlZadRlnOAFjAJYwPjHD3yZUTMOIqoj1oE8FW-P9H1rE0XzfddP1-f89N0YCgNdCz7nuWgTA6FRyF9TQdBsZYWlEQoIFYL90HYPkABJBFoUpAvBRgdEYe5nggMBHj2IA}{Open in Shinylive} - \if{html}{\out{}} - \if{html}{\out{}} + \if{html}{\out{}} + \if{html}{\out{}} } \item{example-2}{ \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXQBBHwCAGWTdVIxMxERGRpalAF9FCAArIhU0gGs4VlEK3Nt8-jgTKGFSNIJ+WlECNLGJ6dngaHg5zLkAXTdodDaVYvZakNzdAF4X8NxnviERUXeul+wjETwgdTqpBgaQ2BEYRFEonC9BEYIhEOoUHocGogIUYC88MR9ix8Twz3RUUBmTS0VIzA0aVEqDgBDR6IhmVOeg++L6zXx33BHLqohxrNIgLFIkZzNZ7JFdUx2NxvLAAXFGl0WhYtFJcEQgopioIJXGBDEgJ1jD1KLgmzNtAt51ywGAfKaArAl0uVVEgnoYslHzMFk01gu1WNit0tH4VPyAEIdehqBxKrGICUZMVRFVqEQJE7uOwAIxyKps-E+MJwQW6fEABQA8gE-AANDT1putjvUUj4uTDGPoxhwUiCRgQdjcl3hOTAONRS7DkdDIUj3TSiVwfh4gnNxwAOQcAE0jcKYzB1rQ4jz7E5nBuR0RGMsx3uPg4XM+YyZaFEu6AgAYvUzQBK4l4cqu6IVtGuisNSuS0lE9LqBscpVlB6JcrA94ev05LYRC25ah8pEYSyWGbsqOL7hqMqStatoiIaRGbqa5qWh8zH6g6XFzlAboEV6Pp+gGQaAqGlgRgsUbESKS5tCmcTprkVQ7BgqwaK++aFsW1BlkO8EimOE5TjOeGCQuS4riZELrvZoqauQn4Nuqzjthem7Xv2t4iCBYEQb+ir-oBbmgeBkExjBEKxauwzDLQJi6OwKjkAymg6DYtg1MKohlBArD1Og7BoKgAAkgi0FU5UVWKjA6IwwwDEoYADJcQA}{Open in Shinylive} - \if{html}{\out{}} - \if{html}{\out{}} + \if{html}{\out{}} + \if{html}{\out{}} } } } From 2183ecd7f6c2e1754072e6ac4cc86d23c7ad5aeb Mon Sep 17 00:00:00 2001 From: vedhav Date: Mon, 17 Feb 2025 16:18:57 +0530 Subject: [PATCH 5/5] chore: doc changes --- R/tm_g_distribution.R | 8 ++++---- R/tm_missing_data.R | 14 +++++++------- R/tm_outliers.R | 8 ++++---- man/tm_g_distribution.Rd | 8 ++++---- man/tm_missing_data.Rd | 8 ++++---- man/tm_outliers.Rd | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index b3cebb041..6c9331277 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -42,10 +42,10 @@ #' tm_g_distribution( #' ..., # arguments for module #' decorators = list( -#' histogram_plot = list(teal_transform_module(...)), # applied only to `histogram_plot` output -#' qq_plot = list(teal_transform_module(...)), # applied only to `qq_plot` output -#' summary_table = list(teal_transform_module(...)), # applied only to `summary_table` output -#' test_table = list(teal_transform_module(...)) # applied only to `test_table` output +#' histogram_plot = teal_transform_module(...), # applied only to `histogram_plot` output +#' qq_plot = teal_transform_module(...), # applied only to `qq_plot` output +#' summary_table = teal_transform_module(...), # applied only to `summary_table` output +#' test_table = teal_transform_module(...) # applied only to `test_table` output #' ) #' ) #' ``` diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 96578be25..0b789b066 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -33,10 +33,10 @@ #' tm_missing_data( #' ..., # arguments for module #' decorators = list( -#' summary_plot = list(teal_transform_module(...)), # applied only to `summary_plot` output -#' combination_plot = list(teal_transform_module(...)), # applied only to `combination_plot` output -#' by_subject_plot = list(teal_transform_module(...)), # applied only to `by_subject_plot` output -#' table = list(teal_transform_module(...)) # applied only to `table` output +#' summary_plot = teal_transform_module(...), # applied only to `summary_plot` output +#' combination_plot = teal_transform_module(...), # applied only to `combination_plot` output +#' by_subject_plot = teal_transform_module(...), # applied only to `by_subject_plot` output +#' table = teal_transform_module(...) # applied only to `table` output #' ) #' ) #' ``` @@ -145,7 +145,7 @@ tm_missing_data <- function(label = "Missing data", checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) - available_decorators <- c("summary_plot", "combination_plot", "by_subject_plot", "summary_table") + available_decorators <- c("summary_plot", "combination_plot", "by_subject_plot", "table") assert_decorators(decorators, names = available_decorators) # End of assertions @@ -443,7 +443,7 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data selected = "counts", inline = TRUE ), - ui_decorate_teal_data(ns("dec_summary_table"), decorators = select_decorators(decorators, "summary_table")) + ui_decorate_teal_data(ns("dec_summary_table"), decorators = select_decorators(decorators, "table")) ), teal.widgets::panel_item( title = "Plot settings", @@ -1292,7 +1292,7 @@ srv_missing_data <- function(id, decorated_summary_table_q <- srv_decorate_teal_data( id = "dec_summary_table", data = summary_table_q, - decorators = select_decorators(decorators, "summary_table"), + decorators = select_decorators(decorators, "table"), expr = table ) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 53d9e21b6..fcd8ac75c 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -31,10 +31,10 @@ #' tm_outliers( #' ..., # arguments for module #' decorators = list( -#' box_plot = list(teal_transform_module(...)), # applied only to `box_plot` output -#' density_plot = list(teal_transform_module(...)), # applied only to `density_plot` output -#' cumulative_plot = list(teal_transform_module(...)), # applied only to `cumulative_plot` output -#' table = list(teal_transform_module(...)) # applied only to `table` output +#' box_plot = teal_transform_module(...), # applied only to `box_plot` output +#' density_plot = teal_transform_module(...), # applied only to `density_plot` output +#' cumulative_plot = teal_transform_module(...), # applied only to `cumulative_plot` output +#' table = teal_transform_module(...) # applied only to `table` output #' ) #' ) #' ``` diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index 7220d2de5..5d7cd5450 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -103,10 +103,10 @@ See code snippet below: \if{html}{\out{
}}\preformatted{tm_g_distribution( ..., # arguments for module decorators = list( - histogram_plot = list(teal_transform_module(...)), # applied only to `histogram_plot` output - qq_plot = list(teal_transform_module(...)), # applied only to `qq_plot` output - summary_table = list(teal_transform_module(...)), # applied only to `summary_table` output - test_table = list(teal_transform_module(...)) # applied only to `test_table` output + histogram_plot = teal_transform_module(...), # applied only to `histogram_plot` output + qq_plot = teal_transform_module(...), # applied only to `qq_plot` output + summary_table = teal_transform_module(...), # applied only to `summary_table` output + test_table = teal_transform_module(...) # applied only to `test_table` output ) ) }\if{html}{\out{
}} diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index cea6fe94e..6656db91b 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -97,10 +97,10 @@ See code snippet below: \if{html}{\out{
}}\preformatted{tm_missing_data( ..., # arguments for module decorators = list( - summary_plot = list(teal_transform_module(...)), # applied only to `summary_plot` output - combination_plot = list(teal_transform_module(...)), # applied only to `combination_plot` output - by_subject_plot = list(teal_transform_module(...)), # applied only to `by_subject_plot` output - table = list(teal_transform_module(...)) # applied only to `table` output + summary_plot = teal_transform_module(...), # applied only to `summary_plot` output + combination_plot = teal_transform_module(...), # applied only to `combination_plot` output + by_subject_plot = teal_transform_module(...), # applied only to `by_subject_plot` output + table = teal_transform_module(...) # applied only to `table` output ) ) }\if{html}{\out{
}} diff --git a/man/tm_outliers.Rd b/man/tm_outliers.Rd index 4dedf1bd0..cc1db497f 100644 --- a/man/tm_outliers.Rd +++ b/man/tm_outliers.Rd @@ -87,10 +87,10 @@ See code snippet below: \if{html}{\out{
}}\preformatted{tm_outliers( ..., # arguments for module decorators = list( - box_plot = list(teal_transform_module(...)), # applied only to `box_plot` output - density_plot = list(teal_transform_module(...)), # applied only to `density_plot` output - cumulative_plot = list(teal_transform_module(...)), # applied only to `cumulative_plot` output - table = list(teal_transform_module(...)) # applied only to `table` output + box_plot = teal_transform_module(...), # applied only to `box_plot` output + density_plot = teal_transform_module(...), # applied only to `density_plot` output + cumulative_plot = teal_transform_module(...), # applied only to `cumulative_plot` output + table = teal_transform_module(...) # applied only to `table` output ) ) }\if{html}{\out{
}}