diff --git a/R/dummy_functions.R b/R/dummy_functions.R index 9588c50586..3b23a73850 100644 --- a/R/dummy_functions.R +++ b/R/dummy_functions.R @@ -2,6 +2,12 @@ #' #' `r lifecycle::badge("experimental")` #' +#' This module creates an object called `object` that can be modified with decorators. +#' The `object` is determined by what's selected in `Choose a dataset` input in UI. +#' The object can be anything that can be handled by `renderPrint()`. +#' See the `vignette("decorate-modules-output", package = "teal")` or [`teal_transform_module`] +#' to read more about decorators. +#' #' @inheritParams teal_modules #' @return A `teal` module which can be included in the `modules` argument to [init()]. #' @examples @@ -40,7 +46,7 @@ example_module <- function(label = "example teal module", datanames = "all", tra table_data <- reactive({ within(data(), { - table <- dataname + object <- dataname }, dataname = as.name(input$dataname) ) @@ -50,7 +56,7 @@ example_module <- function(label = "example teal module", datanames = "all", tra output$text <- renderPrint({ req(table_data_decorated) - table_data_decorated()[["table"]] + table_data_decorated()[["object"]] }) teal.widgets::verbatim_popup_srv( diff --git a/man/example_module.Rd b/man/example_module.Rd index e3898b696a..c36f7c6451 100644 --- a/man/example_module.Rd +++ b/man/example_module.Rd @@ -35,6 +35,13 @@ A \code{teal} module which can be included in the \code{modules} argument to \co \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} } +\details{ +This module creates an object called \code{object} that can be modified with decorators. +The \code{object} is determined by what's selected in \verb{Choose a dataset} input in UI. +The object can be anything that can be handled by \code{renderPrint()}. +See the \code{vignette("decorate-modules-output", package = "teal")} or \code{\link{teal_transform_module}} +to read more about decorators. +} \examples{ app <- init( data = teal_data(IRIS = iris, MTCARS = mtcars),