From 9d526721beab022d34dae2d97c735d22e822832d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 8 Jan 2025 13:14:59 +0100 Subject: [PATCH 01/56] Add datasets_selected argument --- R/tm_missing_data.R | 6 +++++- man/tm_missing_data.Rd | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 97469e39e..680d7fb44 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -7,6 +7,7 @@ #' #' @inheritParams teal::module #' @inheritParams shared_params +#' @inheritParams tm_data_table #' @param parent_dataname (`character(1)`) Specifies the parent dataset name. Default is `ADSL` for `CDISC` data. #' If provided and exists, enables additional analysis "by subject". For non-`CDISC` data, this parameter can be #' ignored. @@ -110,6 +111,7 @@ tm_missing_data <- function(label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, + datasets_selected = character(0L), parent_dataname = "ADSL", ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"), ggplot2_args = list( @@ -143,6 +145,7 @@ tm_missing_data <- function(label = "Missing data", lower = plot_width[2], upper = plot_width[3], null.ok = TRUE, .var.name = "plot_width" ) + checkmate::assert_character(datasets_selected) checkmate::assert_character(parent_dataname, min.len = 0, max.len = 1) ggtheme <- match.arg(ggtheme) @@ -158,9 +161,11 @@ tm_missing_data <- function(label = "Missing data", assert_decorators(decorators, null.ok = TRUE, names = available_decorators) # End of assertions + datasets_selected <- unique(datasets_selected) ans <- module( label, server = srv_page_missing_data, + datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, @@ -170,7 +175,6 @@ tm_missing_data <- function(label = "Missing data", decorators = decorators ), ui = ui_page_missing_data, - datanames = "all", ui_args = list(pre_output = pre_output, post_output = post_output) ) attr(ans, "teal_bookmarkable") <- TRUE diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index 86517c88c..a7caf4fbd 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -8,6 +8,7 @@ tm_missing_data( label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, + datasets_selected = character(0L), parent_dataname = "ADSL", ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"), ggplot2_args = list(`Combinations Hist` = teal.widgets::ggplot2_args(labs = @@ -28,6 +29,11 @@ For \code{modules()} defaults to \code{"root"}. See \code{Details}.} \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} +\item{datasets_selected}{(\code{character}) A vector of datasets which should be +shown and in what order. Names in the vector have to correspond with datasets names. +If vector of \code{length == 0} (default) then all datasets are shown. +Note: Only datasets of the \code{data.frame} class are compatible.} + \item{parent_dataname}{(\code{character(1)}) Specifies the parent dataset name. Default is \code{ADSL} for \code{CDISC} data. If provided and exists, enables additional analysis "by subject". For non-\code{CDISC} data, this parameter can be ignored.} From 4cab9d5cdf6f19d2fd1d33f7712337dbfc1b2f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 8 Jan 2025 13:16:26 +0100 Subject: [PATCH 02/56] Use datasets_selected for datanames --- R/tm_variable_browser.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 96c58718d..d29ed7a0b 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -114,7 +114,7 @@ tm_variable_browser <- function(label = "Variable Browser", label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = "all", + datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, server_args = list( datasets_selected = datasets_selected, parent_dataname = parent_dataname, From 01af1e5e326e882240fe1e82fc9e475f2597ec19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 8 Jan 2025 14:30:25 +0100 Subject: [PATCH 03/56] Add datasets_selected --- R/tm_front_page.R | 15 +++++++++++++-- man/tm_front_page.Rd | 8 +++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 841b38f86..8d20ba451 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -14,6 +14,7 @@ #' @param footnotes (`character` vector) of text to be shown at the bottom of the module, for each #' element, if named the name is shown first in bold, followed by the value. #' @param show_metadata (`logical`) indicating whether the metadata of the datasets be available on the module. +#' @inheritParams tm_variable_browser #' #' @inherit shared_params return #' @@ -69,7 +70,8 @@ tm_front_page <- function(label = "Front page", tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = FALSE) { + show_metadata = FALSE, + datasets_selected = character(0L)) { message("Initializing tm_front_page") # Start of assertions @@ -79,10 +81,19 @@ tm_front_page <- function(label = "Front page", checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html")) checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE) checkmate::assert_flag(show_metadata) + checkmate::assert_character(datasets_selected, min.len = 0, min.chars = 1) + # End of assertions # Make UI args args <- as.list(environment()) + datanames <- if (show_metadata && length(datasets_selected) > 0L) { + datasets_selected + } else if (show_metadata) { + "all" + } else { + NULL + } ans <- module( label = label, @@ -90,7 +101,7 @@ tm_front_page <- function(label = "Front page", ui = ui_front_page, ui_args = args, server_args = list(tables = tables, show_metadata = show_metadata), - datanames = if (show_metadata) "all" else NULL + datanames = datanames ) attr(ans, "teal_bookmarkable") <- TRUE ans diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index b19d33651..a1c354b8a 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -10,7 +10,8 @@ tm_front_page( tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = FALSE + show_metadata = FALSE, + datasets_selected = character(0L) ) } \arguments{ @@ -31,6 +32,11 @@ for example to include an image, \code{tagList(tags$img(src = "image.png"))} or element, if named the name is shown first in bold, followed by the value.} \item{show_metadata}{(\code{logical}) indicating whether the metadata of the datasets be available on the module.} + +\item{datasets_selected}{(\code{character}) A vector of datasets which should be +shown and in what order. Names in the vector have to correspond with datasets names. +If vector of \code{length == 0} (default) then all datasets are shown. +Note: Only datasets of the \code{data.frame} class are compatible.} } \value{ Object of class \code{teal_module} to be used in \code{teal} applications. From 7d1d1e95f8862ee4aeb66b43df62ae6d8b34920a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 8 Jan 2025 14:30:40 +0100 Subject: [PATCH 04/56] Improve checks on datasets_selected --- R/tm_missing_data.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 680d7fb44..677b1610a 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -145,7 +145,7 @@ tm_missing_data <- function(label = "Missing data", lower = plot_width[2], upper = plot_width[3], null.ok = TRUE, .var.name = "plot_width" ) - checkmate::assert_character(datasets_selected) + checkmate::assert_character(datasets_selected, min.len = 0, min.chars = 1) checkmate::assert_character(parent_dataname, min.len = 0, max.len = 1) ggtheme <- match.arg(ggtheme) From f64f3a03f6b8c1167aa14ab6644becd41cab49de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 8 Jan 2025 14:42:02 +0100 Subject: [PATCH 05/56] Rstudio new version adds an id --- teal.modules.general.Rproj | 1 + 1 file changed, 1 insertion(+) diff --git a/teal.modules.general.Rproj b/teal.modules.general.Rproj index 4713d6572..799fecd91 100644 --- a/teal.modules.general.Rproj +++ b/teal.modules.general.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: da9d7aac-6635-4d40-a6f3-881a397ffae1 RestoreWorkspace: No SaveWorkspace: No From f23555da9fd628aed95bb7a8393d05c7a8470e55 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:23:01 +0000 Subject: [PATCH 06/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_front_page.Rd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index a1c354b8a..813fe1f83 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -33,10 +33,10 @@ element, if named the name is shown first in bold, followed by the value.} \item{show_metadata}{(\code{logical}) indicating whether the metadata of the datasets be available on the module.} -\item{datasets_selected}{(\code{character}) A vector of datasets which should be -shown and in what order. Names in the vector have to correspond with datasets names. -If vector of \code{length == 0} (default) then all datasets are shown. -Note: Only datasets of the \code{data.frame} class are compatible.} +\item{datasets_selected}{(\code{character}) vector of datasets which should be +shown, in order. Names must correspond with datasets names. +If vector of length zero (default) then all datasets are shown. +Note: Only \code{data.frame} objects are compatible; using other types will cause an error.} } \value{ Object of class \code{teal_module} to be used in \code{teal} applications. From 766a3c656d02f080f2ab6039085e7aac134e67a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 9 Jan 2025 14:47:03 +0100 Subject: [PATCH 07/56] Rename argument --- R/tm_data_table.R | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 0f1e6a9a8..5f15cc293 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -20,6 +20,10 @@ #' shown and in what order. Names in the vector have to correspond with datasets names. #' If vector of `length == 0` (default) then all datasets are shown. #' Note: Only datasets of the `data.frame` class are compatible. +#' @param datanames (`character`) A vector of datasets which should be +#' shown and in what order. Names in the vector have to correspond with datasets names. +#' If vector of `length == 0` (default) then all datasets are shown. +#' *Note*: Only datasets of the `data.frame` class are compatible. #' @param dt_args (`named list`) Additional arguments to be passed to [DT::datatable()] #' (must not include `data` or `options`). #' @param dt_options (`named list`) The `options` argument to `DT::datatable`. By default @@ -95,7 +99,8 @@ #' tm_data_table <- function(label = "Data Table", variables_selected = list(), - datasets_selected = character(0), + datasets_selected = NULL + datanames = character(0L) dt_args = list(), dt_options = list( searching = FALSE, @@ -122,7 +127,7 @@ tm_data_table <- function(label = "Data Table", }) } - checkmate::assert_character(datasets_selected, min.len = 0, min.chars = 1) + checkmate::assert_character(datanames, min.len = 0, min.chars = 1) checkmate::assert( checkmate::check_list(dt_args, len = 0), checkmate::check_subset(names(dt_args), choices = names(formals(DT::datatable))) @@ -140,10 +145,10 @@ tm_data_table <- function(label = "Data Table", label, server = srv_page_data_table, ui = ui_page_data_table, - datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, + datanames = if (length(datanames) == 0) "all" else datanames, server_args = list( variables_selected = variables_selected, - datasets_selected = datasets_selected, + datanames = datanames, dt_args = dt_args, dt_options = dt_options, server_rendering = server_rendering, @@ -193,7 +198,7 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) { # Server page module srv_page_data_table <- function(id, data, - datasets_selected, + datanames, variables_selected, dt_args, dt_options, @@ -212,9 +217,9 @@ srv_page_data_table <- function(id, is.data.frame(isolate(data())[[name]]) }, datanames) - if (!identical(datasets_selected, character(0))) { - checkmate::assert_subset(datasets_selected, datanames) - datanames <- datasets_selected + if (!identical(datanames, character(0))) { + checkmate::assert_subset(datanames, datanames) + datanames <- datanames } output$dataset_table <- renderUI({ From b782def76cc4adc70f49a5e1dc54acb4492fe5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 09:54:07 +0100 Subject: [PATCH 08/56] Rename datasets_selected to datanames --- R/tm_data_table.R | 21 ++++++++++----------- R/tm_missing_data.R | 9 ++++----- R/tm_variable_browser.R | 30 +++++++++++++++++------------- man/tm_data_table.Rd | 21 ++++++++++++++++----- man/tm_missing_data.Rd | 14 +++++++++----- man/tm_variable_browser.Rd | 16 +++++++++++++--- 6 files changed, 69 insertions(+), 42 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 5f15cc293..4a9131d2d 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -16,14 +16,10 @@ #' Names of list elements should correspond to the names of the datasets available in the app. #' If no entry is specified for a dataset, the first six variables from that #' dataset will initially be shown. -#' @param datasets_selected (`character`) A vector of datasets which should be +#' @param datasets_selected (`character`) `r lifecycle::badge("deprecated")` A vector of datasets which should be #' shown and in what order. Names in the vector have to correspond with datasets names. #' If vector of `length == 0` (default) then all datasets are shown. #' Note: Only datasets of the `data.frame` class are compatible. -#' @param datanames (`character`) A vector of datasets which should be -#' shown and in what order. Names in the vector have to correspond with datasets names. -#' If vector of `length == 0` (default) then all datasets are shown. -#' *Note*: Only datasets of the `data.frame` class are compatible. #' @param dt_args (`named list`) Additional arguments to be passed to [DT::datatable()] #' (must not include `data` or `options`). #' @param dt_options (`named list`) The `options` argument to `DT::datatable`. By default @@ -87,7 +83,8 @@ #' modules = modules( #' tm_data_table( #' variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")), -#' dt_args = list(caption = "ADSL Table Caption") +#' dt_args = list(caption = "ADSL Table Caption"), +#' datasets_selected = "whatever" #' ) #' ) #' ) @@ -99,8 +96,8 @@ #' tm_data_table <- function(label = "Data Table", variables_selected = list(), - datasets_selected = NULL - datanames = character(0L) + datasets_selected = NULL, + datanames = NULL, dt_args = list(), dt_options = list( searching = FALSE, @@ -126,8 +123,11 @@ tm_data_table <- function(label = "Data Table", } }) } - - checkmate::assert_character(datanames, min.len = 0, min.chars = 1) + if (!is.null(datasets_selected)) { + lifecycle::deprecate_stop(when = "0.4.0", + what = "tm_data_table(datasets_selected = 'is deprecated, use `datanames`')") + } + checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) checkmate::assert( checkmate::check_list(dt_args, len = 0), checkmate::check_subset(names(dt_args), choices = names(formals(DT::datatable))) @@ -219,7 +219,6 @@ srv_page_data_table <- function(id, if (!identical(datanames, character(0))) { checkmate::assert_subset(datanames, datanames) - datanames <- datanames } output$dataset_table <- renderUI({ diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 677b1610a..8ba45a869 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -7,7 +7,6 @@ #' #' @inheritParams teal::module #' @inheritParams shared_params -#' @inheritParams tm_data_table #' @param parent_dataname (`character(1)`) Specifies the parent dataset name. Default is `ADSL` for `CDISC` data. #' If provided and exists, enables additional analysis "by subject". For non-`CDISC` data, this parameter can be #' ignored. @@ -111,7 +110,7 @@ tm_missing_data <- function(label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, - datasets_selected = character(0L), + datanames = NULL, parent_dataname = "ADSL", ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"), ggplot2_args = list( @@ -145,7 +144,7 @@ tm_missing_data <- function(label = "Missing data", lower = plot_width[2], upper = plot_width[3], null.ok = TRUE, .var.name = "plot_width" ) - checkmate::assert_character(datasets_selected, min.len = 0, min.chars = 1) + checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) checkmate::assert_character(parent_dataname, min.len = 0, max.len = 1) ggtheme <- match.arg(ggtheme) @@ -161,11 +160,11 @@ tm_missing_data <- function(label = "Missing data", assert_decorators(decorators, null.ok = TRUE, names = available_decorators) # End of assertions - datasets_selected <- unique(datasets_selected) + datanames <- unique(datanames) ans <- module( label, server = srv_page_missing_data, - datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, + datanames = if (length(datanames) == 0) "all" else datanames, server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index d29ed7a0b..aa9302b70 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -10,11 +10,11 @@ #' @inheritParams teal::module #' @inheritParams shared_params #' @param parent_dataname (`character(1)`) string specifying a parent dataset. -#' If it exists in `datasets_selected`then an extra checkbox will be shown to +#' If it exists in `datanames`then an extra checkbox will be shown to #' allow users to not show variables in other datasets which exist in this `dataname`. #' This is typically used to remove `ADSL` columns in `CDISC` data. #' In non `CDISC` data this can be ignored. Defaults to `"ADSL"`. -#' @param datasets_selected (`character`) vector of datasets which should be +#' @param datasets_selected (`character`) `r lifecycle::badge("deprecated")` vector of datasets which should be #' shown, in order. Names must correspond with datasets names. #' If vector of length zero (default) then all datasets are shown. #' Note: Only `data.frame` objects are compatible; using other types will cause an error. @@ -81,7 +81,8 @@ #' @export #' tm_variable_browser <- function(label = "Variable Browser", - datasets_selected = character(0), + datasets_selected = NULL, + datanames = NULL, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, @@ -101,22 +102,26 @@ tm_variable_browser <- function(label = "Variable Browser", # Start of assertions checkmate::assert_string(label) - checkmate::assert_character(datasets_selected) + if (!is.null(datasets_selected)) { + lifecycle::deprecate_stop(when = "0.4.0", + what = "tm_variable_browser(datasets_selected = 'is deprecated, use `datanames`')") + } + checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) checkmate::assert_character(parent_dataname, min.len = 0, max.len = 1) 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) checkmate::assert_class(ggplot2_args, "ggplot2_args") # End of assertions - datasets_selected <- unique(datasets_selected) + datanames <- unique(datanames) ans <- module( label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, + datanames = if (length(datanames) == 0) "all" else datanames, server_args = list( - datasets_selected = datasets_selected, + datanames = datanames, parent_dataname = parent_dataname, ggplot2_args = ggplot2_args ), @@ -205,7 +210,7 @@ srv_variable_browser <- function(id, data, reporter, filter_panel_api, - datasets_selected, parent_dataname, ggplot2_args) { + datanames, parent_dataname, ggplot2_args) { with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") @@ -228,11 +233,10 @@ srv_variable_browser <- function(id, is.data.frame(isolate(data())[[name]]) }, datanames) - checkmate::assert_character(datasets_selected) - checkmate::assert_subset(datasets_selected, datanames) - if (!identical(datasets_selected, character(0))) { - checkmate::assert_subset(datasets_selected, datanames) - datanames <- datasets_selected + checkmate::assert_character(datanames) + checkmate::assert_subset(datanames, datanames) + if (!identical(datanames, character(0))) { + checkmate::assert_subset(datanames, datanames) } output$ui_variable_browser <- renderUI({ diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index 78864c9c4..6caacfaef 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -7,7 +7,8 @@ tm_data_table( label = "Data Table", variables_selected = list(), - datasets_selected = character(0), + datasets_selected = NULL, + datanames = NULL, dt_args = list(), dt_options = list(searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), scrollX = TRUE), @@ -27,11 +28,20 @@ Names of list elements should correspond to the names of the datasets available If no entry is specified for a dataset, the first six variables from that dataset will initially be shown.} -\item{datasets_selected}{(\code{character}) A vector of datasets which should be +\item{datasets_selected}{(\code{character}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} A vector of datasets which should be shown and in what order. Names in the vector have to correspond with datasets names. If vector of \code{length == 0} (default) then all datasets are shown. Note: Only datasets of the \code{data.frame} class are compatible.} +\item{datanames}{(\code{character}) Names of the datasets relevant to the item. +There are 2 reserved values that have specific behaviors: +\itemize{ +\item The keyword \code{"all"} includes all datasets available in the data passed to the teal application. +\item \code{NULL} hides the sidebar panel completely. +\item If \code{transformators} are specified, their \code{datanames} are automatically added to this \code{datanames} +argument. +}} + \item{dt_args}{(\verb{named list}) Additional arguments to be passed to \code{\link[DT:datatable]{DT::datatable()}} (must not include \code{data} or \code{options}).} @@ -116,7 +126,8 @@ app <- init( modules = modules( tm_data_table( variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")), - dt_args = list(caption = "ADSL Table Caption") + dt_args = list(caption = "ADSL Table Caption"), + datasets_selected = "whatever" ) ) ) @@ -133,8 +144,8 @@ if (interactive()) { \if{html}{\out{}} } \item{example-2}{ - \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWTdVIxMxERGYbGlAF9+gCsiFTSAazhWUQrc23z+OBMoYVI0gn5aUQI09c2dveBoeH3MuQBdN2h0CZUxXYtRCuV0AF5QeFcCC+EIRKIIbo4cIxMCBnVJjAMrk0uF6CJ0ZjMVoWLQoASxGlRHARBo4PwkXRRKR2AtxpCCMCwAE7I4fABNPw+BR4XSixwBRwAIQAUsLRVVRVK5Qqxcq-HZnGqlWBBgBxVzqnnOAAaorkchhGOJ-EuLAkiMhzNZBDQmhISNF7PsFJE3ndVggFpBdX6YaU-VoJl07BU5GYlh0NlsNQxojKEFYg3Q7DQqAAJC0qvmCzTGDo+sslGAll8gA}{Open in Shinylive} - \if{html}{\out{}} + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWTdVIxMxERGYbGlAF9+gCsiFTSAazhWUQrc23z+OBMoYVI0gn5aUQI09c2dveBoeH3MuQBdN2h0CZUxXYtRCuV0AF5QeFcCC+EIRKIIbo4cIxMCBnVJjAMrk0uF6CJ0ZjMVoWLQoASxGlRHARBo4PwkXRRKR2AtxpCCMCwAE7I4fABNPw+BR4XSixwBRwAIQAUsLRVVRVK5Qqxcq-HZnGqlWBBgBxVzqnnOAAaorkchhGOJ-EuLAkiMhzNZBDQmhISNF7PsFJE3ndVggFutxKhUBppFE1NpcHpjMhooKJTCcB0jFFILq-WzSn6tBMunYKnIzEsOhsthqGNEZQgrEG6HYaFQABIWlUW62aYx0-0lkowEsvkA}{Open in Shinylive} + \if{html}{\out{}} \if{html}{\out{}} } } diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index a7caf4fbd..bdfe6c1fa 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -8,7 +8,7 @@ tm_missing_data( label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, - datasets_selected = character(0L), + datanames = NULL, parent_dataname = "ADSL", ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"), ggplot2_args = list(`Combinations Hist` = teal.widgets::ggplot2_args(labs = @@ -29,10 +29,14 @@ For \code{modules()} defaults to \code{"root"}. See \code{Details}.} \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{datasets_selected}{(\code{character}) A vector of datasets which should be -shown and in what order. Names in the vector have to correspond with datasets names. -If vector of \code{length == 0} (default) then all datasets are shown. -Note: Only datasets of the \code{data.frame} class are compatible.} +\item{datanames}{(\code{character}) Names of the datasets relevant to the item. +There are 2 reserved values that have specific behaviors: +\itemize{ +\item The keyword \code{"all"} includes all datasets available in the data passed to the teal application. +\item \code{NULL} hides the sidebar panel completely. +\item If \code{transformators} are specified, their \code{datanames} are automatically added to this \code{datanames} +argument. +}} \item{parent_dataname}{(\code{character(1)}) Specifies the parent dataset name. Default is \code{ADSL} for \code{CDISC} data. If provided and exists, enables additional analysis "by subject". For non-\code{CDISC} data, this parameter can be diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index 460f1a9b2..c500e95cf 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -6,7 +6,8 @@ \usage{ tm_variable_browser( label = "Variable Browser", - datasets_selected = character(0), + datasets_selected = NULL, + datanames = NULL, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, @@ -17,13 +18,22 @@ tm_variable_browser( \item{label}{(\code{character(1)}) Label shown in the navigation item for the module or module group. For \code{modules()} defaults to \code{"root"}. See \code{Details}.} -\item{datasets_selected}{(\code{character}) vector of datasets which should be +\item{datasets_selected}{(\code{character}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} vector of datasets which should be shown, in order. Names must correspond with datasets names. If vector of length zero (default) then all datasets are shown. Note: Only \code{data.frame} objects are compatible; using other types will cause an error.} +\item{datanames}{(\code{character}) Names of the datasets relevant to the item. +There are 2 reserved values that have specific behaviors: +\itemize{ +\item The keyword \code{"all"} includes all datasets available in the data passed to the teal application. +\item \code{NULL} hides the sidebar panel completely. +\item If \code{transformators} are specified, their \code{datanames} are automatically added to this \code{datanames} +argument. +}} + \item{parent_dataname}{(\code{character(1)}) string specifying a parent dataset. -If it exists in \code{datasets_selected}then an extra checkbox will be shown to +If it exists in \code{datanames}then an extra checkbox will be shown to allow users to not show variables in other datasets which exist in this \code{dataname}. This is typically used to remove \code{ADSL} columns in \code{CDISC} data. In non \code{CDISC} data this can be ignored. Defaults to \code{"ADSL"}.} From 18791dba036605eec3615ec20f1ddf984506bdd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 09:54:55 +0100 Subject: [PATCH 09/56] Deprecate show_metadata and use datanames --- R/tm_front_page.R | 78 ++++++++++++++++++++------------------------ man/tm_front_page.Rd | 23 +++++++------ 2 files changed, 48 insertions(+), 53 deletions(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 8d20ba451..5bb7fc83a 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -13,7 +13,7 @@ #' `HTML("html text here")`. #' @param footnotes (`character` vector) of text to be shown at the bottom of the module, for each #' element, if named the name is shown first in bold, followed by the value. -#' @param show_metadata (`logical`) indicating whether the metadata of the datasets be available on the module. +#' @param show_metadata (`logical`) `r lifecycle::badge("deprecated")` indicating whether the metadata of the datasets be available on the module. #' @inheritParams tm_variable_browser #' #' @inherit shared_params return @@ -52,7 +52,6 @@ #' tables = table_input, #' additional_tags = HTML("Additional HTML or shiny tags go here
"), #' footnotes = c("X" = "is the first footnote", "Y is the second footnote"), -#' show_metadata = TRUE #' ) #' ), #' header = tags$h1("Sample Application"), @@ -70,8 +69,8 @@ tm_front_page <- function(label = "Front page", tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = FALSE, - datasets_selected = character(0L)) { + show_metadata = NULL, + datanames = NULL) { message("Initializing tm_front_page") # Start of assertions @@ -80,27 +79,24 @@ tm_front_page <- function(label = "Front page", checkmate::assert_list(tables, types = "data.frame", names = "named", any.missing = FALSE) checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html")) checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE) - checkmate::assert_flag(show_metadata) - checkmate::assert_character(datasets_selected, min.len = 0, min.chars = 1) + if (!is.null(show_metadata)) { + lifecycle::deprecate_stop(when = "0.4.0", + what = "tm_front_page(show_metadata = 'is deprecated, use `datanames`')") + } + checkmate::assert_character(datanames, min.len = 0, min.chars = 1, + null.ok = TRUE) # End of assertions # Make UI args args <- as.list(environment()) - datanames <- if (show_metadata && length(datasets_selected) > 0L) { - datasets_selected - } else if (show_metadata) { - "all" - } else { - NULL - } ans <- module( label = label, server = srv_front_page, ui = ui_front_page, ui_args = args, - server_args = list(tables = tables, show_metadata = show_metadata), + server_args = list(tables = tables), datanames = datanames ) attr(ans, "teal_bookmarkable") <- TRUE @@ -131,13 +127,11 @@ ui_front_page <- function(id, ...) { class = "my-4", args$additional_tags ), - if (args$show_metadata) { - tags$div( - id = "front_page_metabutton", - class = "m-4", - actionButton(ns("metadata_button"), "Show metadata") - ) - }, + tags$div( + id = "front_page_metabutton", + class = "m-4", + actionButton(ns("metadata_button"), "Show metadata") + ), tags$footer( class = ".small", get_footer_tags(args$footnotes) @@ -147,7 +141,7 @@ ui_front_page <- function(id, ...) { } # Server function for the front page module -srv_front_page <- function(id, data, tables, show_metadata) { +srv_front_page <- function(id, data, tables) { checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { @@ -166,31 +160,29 @@ srv_front_page <- function(id, data, tables, show_metadata) { ) }) - if (show_metadata) { - observeEvent( - input$metadata_button, showModal( - modalDialog( - title = "Metadata", - dataTableOutput(ns("metadata_table")), - size = "l", - easyClose = TRUE - ) + observeEvent( + input$metadata_button, showModal( + modalDialog( + title = "Metadata", + dataTableOutput(ns("metadata_table")), + size = "l", + easyClose = TRUE ) ) + ) - metadata_data_frame <- reactive({ - datanames <- names(data()) - convert_metadata_to_dataframe( - lapply(datanames, function(dataname) attr(data()[[dataname]], "metadata")), - datanames - ) - }) + metadata_data_frame <- reactive({ + datanames <- names(data()) + convert_metadata_to_dataframe( + lapply(datanames, function(dataname) attr(data()[[dataname]], "metadata")), + datanames + ) + }) - output$metadata_table <- renderDataTable({ - validate(need(nrow(metadata_data_frame()) > 0, "The data has no associated metadata")) - metadata_data_frame() - }) - } + output$metadata_table <- renderDataTable({ + validate(need(nrow(metadata_data_frame()) > 0, "The data has no associated metadata")) + metadata_data_frame() + }) }) } diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index a1c354b8a..89f998ba2 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -10,8 +10,8 @@ tm_front_page( tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = FALSE, - datasets_selected = character(0L) + show_metadata = NULL, + datanames = NULL ) } \arguments{ @@ -31,12 +31,16 @@ for example to include an image, \code{tagList(tags$img(src = "image.png"))} or \item{footnotes}{(\code{character} vector) of text to be shown at the bottom of the module, for each element, if named the name is shown first in bold, followed by the value.} -\item{show_metadata}{(\code{logical}) indicating whether the metadata of the datasets be available on the module.} +\item{show_metadata}{(\code{logical}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} indicating whether the metadata of the datasets be available on the module.} -\item{datasets_selected}{(\code{character}) A vector of datasets which should be -shown and in what order. Names in the vector have to correspond with datasets names. -If vector of \code{length == 0} (default) then all datasets are shown. -Note: Only datasets of the \code{data.frame} class are compatible.} +\item{datanames}{(\code{character}) Names of the datasets relevant to the item. +There are 2 reserved values that have specific behaviors: +\itemize{ +\item The keyword \code{"all"} includes all datasets available in the data passed to the teal application. +\item \code{NULL} hides the sidebar panel completely. +\item If \code{transformators} are specified, their \code{datanames} are automatically added to this \code{datanames} +argument. +}} } \value{ Object of class \code{teal_module} to be used in \code{teal} applications. @@ -75,7 +79,6 @@ app <- init( tables = table_input, additional_tags = HTML("Additional HTML or shiny tags go here
"), footnotes = c("X" = "is the first footnote", "Y is the second footnote"), - show_metadata = TRUE ) ), header = tags$h1("Sample Application"), @@ -90,8 +93,8 @@ if (interactive()) { \section{Examples in Shinylive}{ \describe{ \item{example-1}{ - \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqX8opKAeNdqAfQ8vG3dPbyNdAHdaUgALFXYgqFxdECVdXUY4AEdBWiz2CDFSYmoiRkUIDIBBABEAZQAZH10-DCTEREY6pvTdT1JGdh7GlIUweC8k8dsIulFSdnHqwTjy8d0AXl1xgDlnertWuFhxsbAk-1EiQUYCOA3t8dFWMli4TQJdabBKgF9KgArIgqfwAazgrFEiTCs2M-DgJigwlI-gI-FoogI-mBoIhUOA0Hg0KScgAum4yFB6CJ-ABGFpJDAmZjwdgASQgJiIW10BCWYGqZx2YAAQjMUnY4AAPUi8-nLYXjcW-SpeGlwfwAJkZYWZrLg7AABgBhIjUQQwKp0o3ygUmpVgWoS3Sm82Wqpa23bfkAVgwvpSADYMEG5Ck3RarboAMzevkCoV4EUquRq6m0mO6rz62CGzncu3jVzJ8YAMRdUtlRbAAHFHQAJGaVJTq2kqVCrFrzRZ9cZ2DN6OmPVqD+m4PtgAca3RakdtzVaidVEXTkSx+djmNKFvQdAtFQxJYrpK8pLLjJ8IQiUS8q-CMTHjIZUgwfwskio1BQKRP58Zd4oARRh-HIasfT-f8MnGdkYFQcovDIXQVG5RgYE8KwIBHGC5QIKAqgkHl3iyDAzj6KCRQAeTiGRkK5cp0M0EhsLAE18N0QjdGIuBSLAcjn3DfiX0HW9tgXfwO1WC8oKAjEmOgAIvAkUTdAbOwAFlGkTfg5Mw7hVI05pyl0UR4ggVhR2UjiiJkPR9CYAA+CUhNMIgiFICB3LEGsAA0WMxVp3lMfIFlc9zPPIR0AE1kNvGiTLgYgIH4MKPK85yV3-UyiEifxJiAsJeQcFx+MqDJBJXQDgN5JTRAAEliOkBXqWBUHXap0DoPD5IyjJuS8xgap-erUETTraG6zDUpkDLd1oExdHYFRyGYSwdBsWw0hXUyVFYDrRrQVA6ryFJDrq0QZB0ColD+JQwD+MkgA}{Open in Shinylive} - \if{html}{\out{}} + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqX8opKAeNdqAfQ8vG3dPbyNdAHdaUgALFXYgqFxdECVdXUY4AEdBWiz2CDFSYmoiRkUIDIBBABEAZQAZH10-DCTEREY6pvTdT1JGdh7GlIUweC8k8dsIulFSdnHqwTjy8d0AXl1xgDlnertWuFhxsbAk-1EiQUYCOA3t8dFWMli4TQJdabBKgF9KgArIgqfwAazgrFEiTCs2M-DgJigwlI-gI-FoogI-mBoIhUOA0Hg0KScgAum4yFB6CJ-ABGFpJDAmZjwdgASQgJiIW10BCWYGqZx2YAAQjMUnY4AAPUi8-nLYXjcW-SpeGlwfwAJkZYWZrLg7AABgBhIjUQQwKp0o3ygUmpVgWoS3Sm82Wqpa23bfkAVgwvpSADYMEG5Ck3RarboAMzevkCoV4EUquRq6m0mO6rz62CGzncu3jVzJ8YAMRdUtlRbAAHFHQAJGaVJTq2kqVCrFrzRZ9cZ2DN6OmPVqD+m4PtgAca3RakdtzVaidVEXTkSx+djmNKFvQdAtFQxJYrpK8pLLjJ8IQiUS8q-CMTHjIZUgwfwskio1BQKRP58Zd4oARRh-HIasfT-f8MnGdkYFQcovDIXQVG5RgYE8KwIBHGC5QIKAqgkHl3iyDAzj6KCRQAeTiGRkK5cp0M0EhsLAE18N0QjdGIuBSLAcjn3DfiX0HW9tgXfwO1WC8oKAjEmOgAIvAkUTdAbOwAFlGkTfg5Mw7hVI05pyl0UR4ggVhR2UjiiJkPR9CYAA+CUhNMIgiFICB3LEGsAA0WMxVp3lMfIFlc9zPPIR0AE1kNvGiTLgYgIH4MKPK85yVwySosukwDgN5JTRAAEliOkBXqWBUHXap0DoPD5IyjJuS8xgCp-YrUETWraHqzDUpkDLd1oExdHYFRyGYSwdBsWw0hXUyVFYGrOrQVAiryFJVqK0QZB0ColD+JQwD+MkgA}{Open in Shinylive} + \if{html}{\out{}} \if{html}{\out{}} } } From 4a3682c458e593dc7b636acaedfef367cce16427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 09:55:16 +0100 Subject: [PATCH 10/56] Update vignette --- vignettes/using-data-table.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/using-data-table.Rmd b/vignettes/using-data-table.Rmd index 46ccde3ea..8874e0321 100644 --- a/vignettes/using-data-table.Rmd +++ b/vignettes/using-data-table.Rmd @@ -72,7 +72,7 @@ mod2 <- tm_data_table( "PARAM", "PARAMCD", "AVISIT", "AVISITN", "AVAL", "CHG" ) ), - datasets_selected = c("ADTTE", "ADLB", "ADSL") + datanames = c("ADTTE", "ADLB", "ADSL") ) # configuration for the advanced usage of DT options and extensions From 02e0408bd08bddfaaf16763c48244409289f420a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 09:55:35 +0100 Subject: [PATCH 11/56] Add tests checking deprecated arguments --- .../testthat/test-shinytest2-tm_data_table.R | 28 ++++++++++++++- .../testthat/test-shinytest2-tm_front_page.R | 31 ++++++++++++++-- .../test-shinytest2-tm_variable_browser.R | 35 ++++++++++++++++++- 3 files changed, 90 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-shinytest2-tm_data_table.R b/tests/testthat/test-shinytest2-tm_data_table.R index c6330d43d..6d8b80b35 100644 --- a/tests/testthat/test-shinytest2-tm_data_table.R +++ b/tests/testthat/test-shinytest2-tm_data_table.R @@ -6,7 +6,7 @@ app_driver_tm_data_table <- function() { variables_selected = list( iris = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species") ), - datasets_selected = c("iris", "mtcars"), + datanames = c("iris", "mtcars"), dt_args = list(caption = "Table Caption"), dt_options = list( searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), @@ -99,3 +99,29 @@ test_that("e2e - tm_data_table: Verify default variable selection and set new se app_driver$stop() }) + +test_that("e2e - tm_data_table: Verify error on datasets_selected", { + skip_if_too_deep(5) + app_driver <- function() { + init_teal_app_driver( + data = simple_teal_data(), + modules = tm_data_table( + label = "Data Table", + variables_selected = list( + iris = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species") + ), + datasets_selected = c("iris", "mtcars"), + dt_args = list(caption = "Table Caption"), + dt_options = list( + searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), + scrollX = TRUE + ), + server_rendering = FALSE, + pre_output = NULL, + post_output = NULL + ), + timeout = 3000 + ) + } + expect_error(app_driver()) +}) diff --git a/tests/testthat/test-shinytest2-tm_front_page.R b/tests/testthat/test-shinytest2-tm_front_page.R index c329db949..9ed5ccf12 100644 --- a/tests/testthat/test-shinytest2-tm_front_page.R +++ b/tests/testthat/test-shinytest2-tm_front_page.R @@ -14,8 +14,7 @@ app_driver_tm_front_page <- function() { ), tables = list("MTCARS" = head(mtcars, 5), "IRIS" = head(iris, 5)), additional_tags = HTML("Additional HTML or shiny tags go here"), - footnotes = "This is a footnote", - show_metadata = TRUE + footnotes = "This is a footnote" ), timeout = 3000 ) @@ -67,3 +66,31 @@ test_that("e2e - tm_front_page: Verify the module displays metadata", { app_driver$stop() }) +test_that("e2e - tm_front_page: Verify the module displays metadata", { + skip_if_too_deep(5) + app_driver_tm_front_page <- function() { + data <- simple_cdisc_data() + data <- within(data, { + attr(ADSL, "metadata") <- list("Author" = "NEST team", "data_source" = "synthetic data") + }) + + init_teal_app_driver( + data = data, + modules = tm_front_page( + label = "Front page", + header_text = c( + "Important information" = "It can go here.", + "Other information" = "Can go here." + ), + tables = list("MTCARS" = head(mtcars, 5), "IRIS" = head(iris, 5)), + additional_tags = HTML("Additional HTML or shiny tags go here"), + footnotes = "This is a footnote", + show_metadata = TRUE + ), + timeout = 3000 + ) + } + + # show metadata + testthat::expect_error(app_driver_tm_front_page()) +}) diff --git a/tests/testthat/test-shinytest2-tm_variable_browser.R b/tests/testthat/test-shinytest2-tm_variable_browser.R index abf5680f8..1aca5dddc 100644 --- a/tests/testthat/test-shinytest2-tm_variable_browser.R +++ b/tests/testthat/test-shinytest2-tm_variable_browser.R @@ -15,7 +15,7 @@ app_driver_tm_variable_browser <- function() { data = data, modules = tm_variable_browser( label = "Variable browser (e2e)", - datasets_selected = c("iris", "mtcars", "women", "faithful", "CO2"), + datanames = c("iris", "mtcars", "women", "faithful", "CO2"), parent_dataname = "CO2", ggplot2_args = teal.widgets::ggplot2_args( labs = list(subtitle = "Plot generated by Variable Browser Module") @@ -220,3 +220,36 @@ testthat::test_that("e2e - tm_variable_browser: changing plot setting encodings app_driver$stop() }) + + +test_that("e2e - tm_variable_browser: Verify error on datasets_selected", { + skip_if_too_deep(5) + app_driver_tm_variable_browser <- function() { + # general data example + data <- within( + teal.data::teal_data(), + { + iris <- iris + mtcars <- mtcars + women <- women + faithful <- faithful + CO2 <- CO2 # nolint: object_name. + } + ) + + init_teal_app_driver( + data = data, + modules = tm_variable_browser( + label = "Variable browser (e2e)", + datasets_selected = c("iris", "mtcars", "women", "faithful", "CO2"), + parent_dataname = "CO2", + ggplot2_args = teal.widgets::ggplot2_args( + labs = list(subtitle = "Plot generated by Variable Browser Module") + ), + pre_output = shiny::tags$div("A pre-output message for tm_variable_browser"), + post_output = shiny::tags$div("A post-output message for tm_variable_browser") + ) + ) + } + expect_error(app_driver_tm_variable_browser()) +}) From 441d06923aebed543f462d79e5521e0a3119ba3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 09:55:52 +0100 Subject: [PATCH 12/56] Add NEWS entry --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index ec7949c1b..d4356a354 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,13 @@ # teal.modules.general 0.3.0.9061 * Removed `Show Warnings` modals from modules. +* Hard deprecated `datasets_selected` argument of modules in favor of `datanames`. +* Hard deprecated `show_metadata` argument of tm_front_page in favor of `datanames`. ### Enhancements + * Added `teal.logger` functionality for logging changes in shiny inputs in all modules. +* Now all modules control which datasets are shown on the modules. ### Bug fixes * Fixed a bug in `tm_missing_data` in "Group by Subject" that was not using reactive data call. From 677075f8f15b42cc6e647724f420b178e165fad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 09:57:43 +0100 Subject: [PATCH 13/56] Correct example --- R/tm_data_table.R | 3 +-- man/tm_data_table.Rd | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 4a9131d2d..7fc5f7c58 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -83,8 +83,7 @@ #' modules = modules( #' tm_data_table( #' variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")), -#' dt_args = list(caption = "ADSL Table Caption"), -#' datasets_selected = "whatever" +#' dt_args = list(caption = "ADSL Table Caption") #' ) #' ) #' ) diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index 6caacfaef..5d2681577 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -126,8 +126,7 @@ app <- init( modules = modules( tm_data_table( variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")), - dt_args = list(caption = "ADSL Table Caption"), - datasets_selected = "whatever" + dt_args = list(caption = "ADSL Table Caption") ) ) ) @@ -144,8 +143,8 @@ if (interactive()) { \if{html}{\out{}} } \item{example-2}{ - \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWTdVIxMxERGYbGlAF9+gCsiFTSAazhWUQrc23z+OBMoYVI0gn5aUQI09c2dveBoeH3MuQBdN2h0CZUxXYtRCuV0AF5QeFcCC+EIRKIIbo4cIxMCBnVJjAMrk0uF6CJ0ZjMVoWLQoASxGlRHARBo4PwkXRRKR2AtxpCCMCwAE7I4fABNPw+BR4XSixwBRwAIQAUsLRVVRVK5Qqxcq-HZnGqlWBBgBxVzqnnOAAaorkchhGOJ-EuLAkiMhzNZBDQmhISNF7PsFJE3ndVggFutxKhUBppFE1NpcHpjMhooKJTCcB0jFFILq-WzSn6tBMunYKnIzEsOhsthqGNEZQgrEG6HYaFQABIWlUW62aYx0-0lkowEsvkA}{Open in Shinylive} - \if{html}{\out{}} + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWTdVIxMxERGYbGlAF9+gCsiFTSAazhWUQrc23z+OBMoYVI0gn5aUQI09c2dveBoeH3MuQBdN2h0CZUxXYtRCuV0AF5QeFcCC+EIRKIIbo4cIxMCBnVJjAMrk0uF6CJ0ZjMVoWLQoASxGlRHARBo4PwkXRRKR2AtxpCCMCwAE7I4fABNPw+BR4XSixwBRwAIQAUsLRVVRVK5Qqxcq-HZnGqlWBBgBxVzqnnOAAaorkchhGOJ-EuLAkiMhzNZBDQmhISNF7PsFJE3ndVggFpBdX6YaU-VoJl07BU5GYlh0NlsNQxojKEFYg3Q7DQqAAJC0qvmCzTGDo+sslGAll8gA}{Open in Shinylive} + \if{html}{\out{}} \if{html}{\out{}} } } From 24537f38fc0c02c6cc24831c5488e6990d40cc78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 10:02:14 +0100 Subject: [PATCH 14/56] Style the R files --- R/tm_data_table.R | 6 ++-- R/tm_front_page.R | 12 ++++--- R/tm_variable_browser.R | 6 ++-- .../testthat/test-shinytest2-tm_data_table.R | 34 +++++++++---------- 4 files changed, 33 insertions(+), 25 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 7fc5f7c58..d90e11b17 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -123,8 +123,10 @@ tm_data_table <- function(label = "Data Table", }) } if (!is.null(datasets_selected)) { - lifecycle::deprecate_stop(when = "0.4.0", - what = "tm_data_table(datasets_selected = 'is deprecated, use `datanames`')") + lifecycle::deprecate_stop( + when = "0.4.0", + what = "tm_data_table(datasets_selected = 'is deprecated, use `datanames`')" + ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) checkmate::assert( diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 5bb7fc83a..142657b19 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -80,11 +80,15 @@ tm_front_page <- function(label = "Front page", checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html")) checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE) if (!is.null(show_metadata)) { - lifecycle::deprecate_stop(when = "0.4.0", - what = "tm_front_page(show_metadata = 'is deprecated, use `datanames`')") + lifecycle::deprecate_stop( + when = "0.4.0", + what = "tm_front_page(show_metadata = 'is deprecated, use `datanames`')" + ) } - checkmate::assert_character(datanames, min.len = 0, min.chars = 1, - null.ok = TRUE) + checkmate::assert_character(datanames, + min.len = 0, min.chars = 1, + null.ok = TRUE + ) # End of assertions diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index aa9302b70..f05e8e063 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -103,8 +103,10 @@ tm_variable_browser <- function(label = "Variable Browser", # Start of assertions checkmate::assert_string(label) if (!is.null(datasets_selected)) { - lifecycle::deprecate_stop(when = "0.4.0", - what = "tm_variable_browser(datasets_selected = 'is deprecated, use `datanames`')") + lifecycle::deprecate_stop( + when = "0.4.0", + what = "tm_variable_browser(datasets_selected = 'is deprecated, use `datanames`')" + ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) checkmate::assert_character(parent_dataname, min.len = 0, max.len = 1) diff --git a/tests/testthat/test-shinytest2-tm_data_table.R b/tests/testthat/test-shinytest2-tm_data_table.R index 6d8b80b35..e14d7dbec 100644 --- a/tests/testthat/test-shinytest2-tm_data_table.R +++ b/tests/testthat/test-shinytest2-tm_data_table.R @@ -104,24 +104,24 @@ test_that("e2e - tm_data_table: Verify error on datasets_selected", { skip_if_too_deep(5) app_driver <- function() { init_teal_app_driver( - data = simple_teal_data(), - modules = tm_data_table( - label = "Data Table", - variables_selected = list( - iris = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species") - ), - datasets_selected = c("iris", "mtcars"), - dt_args = list(caption = "Table Caption"), - dt_options = list( - searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), - scrollX = TRUE + data = simple_teal_data(), + modules = tm_data_table( + label = "Data Table", + variables_selected = list( + iris = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species") + ), + datasets_selected = c("iris", "mtcars"), + dt_args = list(caption = "Table Caption"), + dt_options = list( + searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), + scrollX = TRUE + ), + server_rendering = FALSE, + pre_output = NULL, + post_output = NULL ), - server_rendering = FALSE, - pre_output = NULL, - post_output = NULL - ), - timeout = 3000 - ) + timeout = 3000 + ) } expect_error(app_driver()) }) From af4143a9f2037195615164a403e45ad0c2e0333a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= <185338939+llrs-roche@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:22:31 +0100 Subject: [PATCH 15/56] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dawid Kałędkowski Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com> --- R/tm_data_table.R | 4 ++-- R/tm_missing_data.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index f8dca2fbc..341e6a28c 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -86,8 +86,8 @@ #' tm_data_table <- function(label = "Data Table", variables_selected = list(), - datasets_selected = NULL, - datanames = NULL, + datasets_selected = "all", + datanames = datasets_selected, dt_args = list(), dt_options = list( searching = FALSE, diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index c8a4f6bd2..383676b42 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -109,7 +109,7 @@ tm_missing_data <- function(label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, - datanames = NULL, + datanames = "all", parent_dataname = "ADSL", ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"), ggplot2_args = list( @@ -163,7 +163,7 @@ tm_missing_data <- function(label = "Missing data", ans <- module( label, server = srv_page_missing_data, - datanames = if (length(datanames) == 0) "all" else datanames, + datanames = datanames, server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, From 0f8eae8aaf7dbbdd4c78bbf2c4b6f98f034186a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 10:27:10 +0100 Subject: [PATCH 16/56] Fix superlinter issue (line > 120 character) --- R/tm_front_page.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 80f5b5476..93b751e9d 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -13,7 +13,8 @@ #' `HTML("html text here")`. #' @param footnotes (`character` vector) of text to be shown at the bottom of the module, for each #' element, if named the name is shown first in bold, followed by the value. -#' @param show_metadata (`logical`) `r lifecycle::badge("deprecated")` indicating whether the metadata of the datasets be available on the module. +#' @param show_metadata (`logical`) `r lifecycle::badge("deprecated")` indicating +#' whether the metadata of the datasets be available on the module. #' @inheritParams tm_variable_browser #' #' @inherit shared_params return From 3b708246cd70adb937a1ac080927d0899a127d53 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 09:28:43 +0000 Subject: [PATCH 17/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_data_table.Rd | 4 ++-- man/tm_missing_data.Rd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index b4a1b8437..b63bb05cb 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -7,8 +7,8 @@ tm_data_table( label = "Data Table", variables_selected = list(), - datasets_selected = NULL, - datanames = NULL, + datasets_selected = "all", + datanames = datasets_selected, dt_args = list(), dt_options = list(searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), scrollX = TRUE), diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index 02d57cc9f..cc9bd6d62 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -8,7 +8,7 @@ tm_missing_data( label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, - datanames = NULL, + datanames = "all", parent_dataname = "ADSL", ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"), ggplot2_args = list(`Combinations Hist` = teal.widgets::ggplot2_args(labs = From 883d667f793480e037512618a96221f76114183e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 10:37:45 +0100 Subject: [PATCH 18/56] Soft deprecate & use datasets_selected argument when possible --- R/tm_data_table.R | 2 +- R/tm_front_page.R | 2 +- R/tm_variable_browser.R | 6 +++--- man/tm_front_page.Rd | 3 ++- man/tm_variable_browser.Rd | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 341e6a28c..c36270ea7 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -113,7 +113,7 @@ tm_data_table <- function(label = "Data Table", }) } if (!is.null(datasets_selected)) { - lifecycle::deprecate_stop( + lifecycle::deprecate_soft( when = "0.4.0", what = "tm_data_table(datasets_selected = 'is deprecated, use `datanames`')" ) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 93b751e9d..35dce494a 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -81,7 +81,7 @@ tm_front_page <- function(label = "Front page", checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html")) checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE) if (!is.null(show_metadata)) { - lifecycle::deprecate_stop( + lifecycle::deprecate_soft( when = "0.4.0", what = "tm_front_page(show_metadata = 'is deprecated, use `datanames`')" ) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index f05e8e063..072ab9087 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -81,8 +81,8 @@ #' @export #' tm_variable_browser <- function(label = "Variable Browser", - datasets_selected = NULL, - datanames = NULL, + datasets_selected = "all", + datanames = datasets_selected, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, @@ -103,7 +103,7 @@ tm_variable_browser <- function(label = "Variable Browser", # Start of assertions checkmate::assert_string(label) if (!is.null(datasets_selected)) { - lifecycle::deprecate_stop( + lifecycle::deprecate_soft( when = "0.4.0", what = "tm_variable_browser(datasets_selected = 'is deprecated, use `datanames`')" ) diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 4dd6b463d..0db863e11 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -31,7 +31,8 @@ for example to include an image, \code{tagList(tags$img(src = "image.png"))} or \item{footnotes}{(\code{character} vector) of text to be shown at the bottom of the module, for each element, if named the name is shown first in bold, followed by the value.} -\item{show_metadata}{(\code{logical}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} indicating whether the metadata of the datasets be available on the module.} +\item{show_metadata}{(\code{logical}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} indicating +whether the metadata of the datasets be available on the module.} \item{datanames}{(\code{character}) Names of the datasets relevant to the item. There are 2 reserved values that have specific behaviors: diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index c500e95cf..614ca9474 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -6,8 +6,8 @@ \usage{ tm_variable_browser( label = "Variable Browser", - datasets_selected = NULL, - datanames = NULL, + datasets_selected = "all", + datanames = datasets_selected, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, From e6e5d1092ffa961bf26bf2af131ca6ed945a123b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 10:49:53 +0100 Subject: [PATCH 19/56] Comment I missed when updating --- R/tm_front_page.R | 1 + man/tm_front_page.Rd | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 35dce494a..1f4b85006 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -15,6 +15,7 @@ #' element, if named the name is shown first in bold, followed by the value. #' @param show_metadata (`logical`) `r lifecycle::badge("deprecated")` indicating #' whether the metadata of the datasets be available on the module. +#' Metadata shown automatically when `datanames` set. #' @inheritParams tm_variable_browser #' #' @inherit shared_params return diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 0db863e11..dfd141666 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -32,7 +32,8 @@ for example to include an image, \code{tagList(tags$img(src = "image.png"))} or element, if named the name is shown first in bold, followed by the value.} \item{show_metadata}{(\code{logical}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} indicating -whether the metadata of the datasets be available on the module.} +whether the metadata of the datasets be available on the module. +Metadata shown automatically when \code{datanames} set.} \item{datanames}{(\code{character}) Names of the datasets relevant to the item. There are 2 reserved values that have specific behaviors: From 6ba19985ef0fd8a16549b737c62aa3559db6723a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 13:04:39 +0100 Subject: [PATCH 20/56] Use full name of the function to avoid spelling false positives (and linking on the websites) --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 21f4b7ce1..d2942e926 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ * Removed `Show Warnings` modals from modules. * Hard deprecated `datasets_selected` argument of modules in favor of `datanames`. -* Hard deprecated `show_metadata` argument of tm_front_page in favor of `datanames`. +* Hard deprecated `show_metadata` argument of `tm_front_page()` in favor of `datanames`. ### Enhancements From bd44f709298057bc31c2b1f69cb9fe16adbbef0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 13:36:42 +0100 Subject: [PATCH 21/56] Prevent breaking user code and simplify code --- R/tm_data_table.R | 5 +++-- R/tm_front_page.R | 9 +++++---- R/tm_variable_browser.R | 5 +++-- man/tm_front_page.Rd | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index c36270ea7..c7a499868 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -115,7 +115,8 @@ tm_data_table <- function(label = "Data Table", if (!is.null(datasets_selected)) { lifecycle::deprecate_soft( when = "0.4.0", - what = "tm_data_table(datasets_selected = 'is deprecated, use `datanames`')" + what = "tm_data_table(datasets_selected", + with = "tm_data_table(datanames)" ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) @@ -134,7 +135,7 @@ tm_data_table <- function(label = "Data Table", label, server = srv_page_data_table, ui = ui_page_data_table, - datanames = if (length(datanames) == 0) "all" else datanames, + datanames = datanames, server_args = list( variables_selected = variables_selected, datanames = datanames, diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 1f4b85006..81b24037e 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -71,8 +71,8 @@ tm_front_page <- function(label = "Front page", tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = NULL, - datanames = NULL) { + show_metadata = TRUE, + datanames = if(isTRUE(show_metadata)) "all" else NULL) { message("Initializing tm_front_page") # Start of assertions @@ -84,7 +84,8 @@ tm_front_page <- function(label = "Front page", if (!is.null(show_metadata)) { lifecycle::deprecate_soft( when = "0.4.0", - what = "tm_front_page(show_metadata = 'is deprecated, use `datanames`')" + what = "tm_front_page(show_metadata)", + with = "tm_front_page(datanames)" ) } checkmate::assert_character(datanames, @@ -103,7 +104,7 @@ tm_front_page <- function(label = "Front page", ui = ui_front_page, ui_args = args, server_args = list(tables = tables), - datanames = datanames + datanames = unique(datanames) ) attr(ans, "teal_bookmarkable") <- TRUE ans diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 072ab9087..eaf85a4ca 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -105,7 +105,8 @@ tm_variable_browser <- function(label = "Variable Browser", if (!is.null(datasets_selected)) { lifecycle::deprecate_soft( when = "0.4.0", - what = "tm_variable_browser(datasets_selected = 'is deprecated, use `datanames`')" + what = "tm_variable_browser(datasets_selected", + with = "tm_variable_browser(datanames)" ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) @@ -121,7 +122,7 @@ tm_variable_browser <- function(label = "Variable Browser", label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = if (length(datanames) == 0) "all" else datanames, + datanames = datanames, server_args = list( datanames = datanames, parent_dataname = parent_dataname, diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index dfd141666..8d1e2fdbf 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -10,8 +10,8 @@ tm_front_page( tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = NULL, - datanames = NULL + show_metadata = TRUE, + datanames = if (isTRUE(show_metadata)) "all" else NULL ) } \arguments{ From 111d2e521dac9a3c38238e598beb25af6499952b Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:39:09 +0000 Subject: [PATCH 22/56] [skip style] [skip vbump] Restyle files --- R/tm_front_page.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 81b24037e..14bfd2fa6 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -72,7 +72,7 @@ tm_front_page <- function(label = "Front page", additional_tags = tagList(), footnotes = character(0), show_metadata = TRUE, - datanames = if(isTRUE(show_metadata)) "all" else NULL) { + datanames = if (isTRUE(show_metadata)) "all" else NULL) { message("Initializing tm_front_page") # Start of assertions From 59401beeb3a3c040328c6fab34b2df2052987d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= <185338939+llrs-roche@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:53:57 +0100 Subject: [PATCH 23/56] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dawid Kałędkowski Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com> --- R/tm_front_page.R | 2 +- R/tm_missing_data.R | 2 +- R/tm_variable_browser.R | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 14bfd2fa6..d54c1221b 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -104,7 +104,7 @@ tm_front_page <- function(label = "Front page", ui = ui_front_page, ui_args = args, server_args = list(tables = tables), - datanames = unique(datanames) + datanames = datanames ) attr(ans, "teal_bookmarkable") <- TRUE ans diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 383676b42..832baf092 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -163,7 +163,7 @@ tm_missing_data <- function(label = "Missing data", ans <- module( label, server = srv_page_missing_data, - datanames = datanames, + datanames = union(datanames, parent_dataname), server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index eaf85a4ca..5d5fb909a 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -116,7 +116,6 @@ tm_variable_browser <- function(label = "Variable Browser", checkmate::assert_class(ggplot2_args, "ggplot2_args") # End of assertions - datanames <- unique(datanames) ans <- module( label, From 1493152136fef7b347f928bcfadaf1e2ff9c380d Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:56:00 +0000 Subject: [PATCH 24/56] [skip style] [skip vbump] Restyle files --- R/tm_missing_data.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 832baf092..8957dccbd 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -163,7 +163,7 @@ tm_missing_data <- function(label = "Missing data", ans <- module( label, server = srv_page_missing_data, - datanames = union(datanames, parent_dataname), + datanames = union(datanames, parent_dataname), server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, From f108aa487e430ae0200324d63c37ff9361c747fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 16:46:49 +0100 Subject: [PATCH 25/56] Keep the same default as before the PR and check if it is used before warning the user. --- R/tm_data_table.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index c7a499868..2e7c743e9 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -86,8 +86,8 @@ #' tm_data_table <- function(label = "Data Table", variables_selected = list(), - datasets_selected = "all", - datanames = datasets_selected, + datasets_selected = character(0), + datanames = if (!length(datasets_selected)) "all" else datasets_selected, dt_args = list(), dt_options = list( searching = FALSE, @@ -112,11 +112,12 @@ tm_data_table <- function(label = "Data Table", } }) } - if (!is.null(datasets_selected)) { + if (!missing(datasets_selected)) { lifecycle::deprecate_soft( when = "0.4.0", - what = "tm_data_table(datasets_selected", - with = "tm_data_table(datanames)" + what = "tm_data_table(datasets_selected)", + with = "tm_data_table(datanames)", + details = 'Use tm_data_table(datanames = "all") to keep the previous behavior and avoid this warning.', ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) From a591612b1ff0aa09f56f8c695bb098cb0cff5083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 16:48:32 +0100 Subject: [PATCH 26/56] Remove unnecessary call --- R/tm_missing_data.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 8957dccbd..32b79ae8e 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -159,7 +159,6 @@ tm_missing_data <- function(label = "Missing data", assert_decorators(decorators, null.ok = TRUE, names = available_decorators) # End of assertions - datanames <- unique(datanames) ans <- module( label, server = srv_page_missing_data, From d79fee8d1f7b85e4d4acc308ac776ce718ad6272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 16:56:12 +0100 Subject: [PATCH 27/56] Add back the button control with datanames --- R/tm_front_page.R | 62 ++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index d54c1221b..4952f436f 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -71,7 +71,7 @@ tm_front_page <- function(label = "Front page", tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = TRUE, + show_metadata = FALSE, datanames = if (isTRUE(show_metadata)) "all" else NULL) { message("Initializing tm_front_page") @@ -81,11 +81,15 @@ tm_front_page <- function(label = "Front page", checkmate::assert_list(tables, types = "data.frame", names = "named", any.missing = FALSE) checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html")) checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE) - if (!is.null(show_metadata)) { + checkmate::assert_flag(show_metadata) + if (!missing(show_metadata)) { lifecycle::deprecate_soft( when = "0.4.0", what = "tm_front_page(show_metadata)", - with = "tm_front_page(datanames)" + with = "tm_front_page(datanames)", + details = c( + "With `datanames` you can select which datasets are displayed.", + i = "Use `tm_front_page(datanames = 'all')` to keep the previous behavior and avoid this warning.") ) } checkmate::assert_character(datanames, @@ -134,11 +138,12 @@ ui_front_page <- function(id, ...) { class = "my-4", args$additional_tags ), - tags$div( - id = "front_page_metabutton", - class = "m-4", - actionButton(ns("metadata_button"), "Show metadata") - ), + if (length(args$datanames) > 0L) { + tags$div( + id = "front_page_metabutton", + class = "m-4", + actionButton(ns("metadata_button"), "Show metadata") + )}, tags$footer( class = ".small", get_footer_tags(args$footnotes) @@ -166,30 +171,31 @@ srv_front_page <- function(id, data, tables) { caption.placement = "top" ) }) - - observeEvent( - input$metadata_button, showModal( - modalDialog( - title = "Metadata", - dataTableOutput(ns("metadata_table")), - size = "l", - easyClose = TRUE + if (length(isolate(names(data()))) > 0L) { + observeEvent( + input$metadata_button, showModal( + modalDialog( + title = "Metadata", + dataTableOutput(ns("metadata_table")), + size = "l", + easyClose = TRUE + ) ) ) - ) - metadata_data_frame <- reactive({ - datanames <- names(data()) - convert_metadata_to_dataframe( - lapply(datanames, function(dataname) attr(data()[[dataname]], "metadata")), - datanames - ) - }) + metadata_data_frame <- reactive({ + datanames <- names(data()) + convert_metadata_to_dataframe( + lapply(datanames, function(dataname) attr(data()[[dataname]], "metadata")), + datanames + ) + }) - output$metadata_table <- renderDataTable({ - validate(need(nrow(metadata_data_frame()) > 0, "The data has no associated metadata")) - metadata_data_frame() - }) + output$metadata_table <- renderDataTable({ + validate(need(nrow(metadata_data_frame()) > 0, "The data has no associated metadata")) + metadata_data_frame() + }) + } }) } From 60f954473d07cd70a4a4575d8f5c3d12182dc300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 16:57:11 +0100 Subject: [PATCH 28/56] The default matches before this PR --- R/tm_variable_browser.R | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 5d5fb909a..34054ac89 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -81,8 +81,8 @@ #' @export #' tm_variable_browser <- function(label = "Variable Browser", - datasets_selected = "all", - datanames = datasets_selected, + datasets_selected = character(0), + datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, @@ -102,11 +102,14 @@ tm_variable_browser <- function(label = "Variable Browser", # Start of assertions checkmate::assert_string(label) - if (!is.null(datasets_selected)) { + if (!missing(datasets_selected)) { lifecycle::deprecate_soft( when = "0.4.0", - what = "tm_variable_browser(datasets_selected", - with = "tm_variable_browser(datanames)" + what = "tm_variable_browser(datasets_selected)", + with = "tm_variable_browser(datanames)", + details = c( + "If both `datasets_selected` and `datanames` are set `datasets_selected` will be silently ignored.", + i = 'Use `tm_variable_browser(datanames = "all")` to keep the previous behavior and avoid this warning.') ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) @@ -121,7 +124,7 @@ tm_variable_browser <- function(label = "Variable Browser", label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = datanames, + datanames = union(datanames, parent_dataname), server_args = list( datanames = datanames, parent_dataname = parent_dataname, @@ -235,12 +238,6 @@ srv_variable_browser <- function(id, is.data.frame(isolate(data())[[name]]) }, datanames) - checkmate::assert_character(datanames) - checkmate::assert_subset(datanames, datanames) - if (!identical(datanames, character(0))) { - checkmate::assert_subset(datanames, datanames) - } - output$ui_variable_browser <- renderUI({ ns <- session$ns do.call( From 1a40f0f146e9ba6891511b49601f08605076ccc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 17:01:06 +0100 Subject: [PATCH 29/56] Styler changes --- R/tm_front_page.R | 6 ++++-- R/tm_variable_browser.R | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 4952f436f..94ec5cca6 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -89,7 +89,8 @@ tm_front_page <- function(label = "Front page", with = "tm_front_page(datanames)", details = c( "With `datanames` you can select which datasets are displayed.", - i = "Use `tm_front_page(datanames = 'all')` to keep the previous behavior and avoid this warning.") + i = "Use `tm_front_page(datanames = 'all')` to keep the previous behavior and avoid this warning." + ) ) } checkmate::assert_character(datanames, @@ -143,7 +144,8 @@ ui_front_page <- function(id, ...) { id = "front_page_metabutton", class = "m-4", actionButton(ns("metadata_button"), "Show metadata") - )}, + ) + }, tags$footer( class = ".small", get_footer_tags(args$footnotes) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 34054ac89..a37c04f7e 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -109,7 +109,8 @@ tm_variable_browser <- function(label = "Variable Browser", with = "tm_variable_browser(datanames)", details = c( "If both `datasets_selected` and `datanames` are set `datasets_selected` will be silently ignored.", - i = 'Use `tm_variable_browser(datanames = "all")` to keep the previous behavior and avoid this warning.') + i = 'Use `tm_variable_browser(datanames = "all")` to keep the previous behavior and avoid this warning.' + ) ) } checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) From bd25c85c1d6d2c88e1930d718474873f70ba7eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 10 Jan 2025 17:02:44 +0100 Subject: [PATCH 30/56] Update NEWS according to changes and discussion --- NEWS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index d2942e926..a7cf97f2e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,8 @@ # teal.modules.general 0.3.0.9062 * Removed `Show Warnings` modals from modules. -* Hard deprecated `datasets_selected` argument of modules in favor of `datanames`. -* Hard deprecated `show_metadata` argument of `tm_front_page()` in favor of `datanames`. +* Soft deprecated `datasets_selected` argument of modules in favor of `datanames`. +* Soft deprecated `show_metadata` argument of `tm_front_page()` in favor of `datanames`. ### Enhancements From 1d1c71664022157f154762b6de0fab34781f6430 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:09:29 +0000 Subject: [PATCH 31/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_data_table.Rd | 4 ++-- man/tm_front_page.Rd | 2 +- man/tm_variable_browser.Rd | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index b63bb05cb..f0da1e9f0 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -7,8 +7,8 @@ tm_data_table( label = "Data Table", variables_selected = list(), - datasets_selected = "all", - datanames = datasets_selected, + datasets_selected = character(0), + datanames = if (!length(datasets_selected)) "all" else datasets_selected, dt_args = list(), dt_options = list(searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), scrollX = TRUE), diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 8d1e2fdbf..2bd30efb8 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -10,7 +10,7 @@ tm_front_page( tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = TRUE, + show_metadata = FALSE, datanames = if (isTRUE(show_metadata)) "all" else NULL ) } diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index 614ca9474..fcf07cdff 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -6,8 +6,8 @@ \usage{ tm_variable_browser( label = "Variable Browser", - datasets_selected = "all", - datanames = datasets_selected, + datasets_selected = character(0), + datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, From e115f24c17c5606b4351ec4d92191409b55f593b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 13 Jan 2025 11:37:18 +0100 Subject: [PATCH 32/56] Use "all" instead of c("all", parent_dataname) --- R/tm_missing_data.R | 2 +- R/tm_variable_browser.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 32b79ae8e..6de2bc607 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -162,7 +162,7 @@ tm_missing_data <- function(label = "Missing data", ans <- module( label, server = srv_page_missing_data, - datanames = union(datanames, parent_dataname), + datanames = if (all(datanames != "all")) union(datanames, parent_dataname) else "all", server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index a37c04f7e..58d0746f5 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -125,7 +125,7 @@ tm_variable_browser <- function(label = "Variable Browser", label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = union(datanames, parent_dataname), + datanames = if (all(datanames != "all")) union(datanames, parent_dataname) else "all", server_args = list( datanames = datanames, parent_dataname = parent_dataname, From 4e7265a6253a4f1a8d319a96dbb1cd6cfc54df02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 13 Jan 2025 14:23:47 +0100 Subject: [PATCH 33/56] Convert check to one line --- R/tm_front_page.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 94ec5cca6..ac8e67d3f 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -93,10 +93,7 @@ tm_front_page <- function(label = "Front page", ) ) } - checkmate::assert_character(datanames, - min.len = 0, min.chars = 1, - null.ok = TRUE - ) + checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE) # End of assertions From cb72e2a6875c2a17164d3e8205b9fdff90dc0485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 13 Jan 2025 17:47:38 +0100 Subject: [PATCH 34/56] Add lifecycle as a dependency --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/utils.R | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index fd1341866..8b3a80993 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,6 +35,7 @@ Imports: DT (>= 0.13), forcats (>= 1.0.0), grid, + lifecycle (>= 0.2.0), rlistings (>= 0.2.8), scales, shinyjs, @@ -66,7 +67,6 @@ Suggests: jsonlite, knitr (>= 1.42), lattice (>= 0.18-4), - lifecycle (>= 0.2.0), logger (>= 0.2.0), MASS, nestcolor (>= 0.1.0), diff --git a/NAMESPACE b/NAMESPACE index 86c4c2a5a..9c0f1aa0f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -31,3 +31,4 @@ import(shiny) import(teal) import(teal.transform) importFrom(dplyr,"%>%") +importFrom(lifecycle,deprecated) diff --git a/R/utils.R b/R/utils.R index c1a8262eb..7adce8839 100644 --- a/R/utils.R +++ b/R/utils.R @@ -421,3 +421,6 @@ normalize_decorators <- function(decorators) { decorators } } + +#' @importFrom lifecycle deprecated +deprecated <- lifecycle::deprecated From e5e29e0f22ee47859441ebae19ce69e48e4a8ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 13 Jan 2025 17:49:15 +0100 Subject: [PATCH 35/56] Use deprecated() and missing --- R/tm_data_table.R | 4 ++-- R/tm_front_page.R | 5 ++--- R/tm_variable_browser.R | 4 ++-- man/tm_data_table.Rd | 4 ++-- man/tm_front_page.Rd | 4 ++-- man/tm_g_distribution.Rd | 4 ++-- man/tm_variable_browser.Rd | 4 ++-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 2e7c743e9..904a2ea5a 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -86,8 +86,8 @@ #' tm_data_table <- function(label = "Data Table", variables_selected = list(), - datasets_selected = character(0), - datanames = if (!length(datasets_selected)) "all" else datasets_selected, + datasets_selected = deprecated(), + datanames = if (missing(datasets_selected)) "all" else datasets_selected, dt_args = list(), dt_options = list( searching = FALSE, diff --git a/R/tm_front_page.R b/R/tm_front_page.R index ac8e67d3f..6153c5ba9 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -71,8 +71,8 @@ tm_front_page <- function(label = "Front page", tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = FALSE, - datanames = if (isTRUE(show_metadata)) "all" else NULL) { + show_metadata = deprecated(), + datanames = if (missing(show_metadata)) "all" else character(0)) { message("Initializing tm_front_page") # Start of assertions @@ -81,7 +81,6 @@ tm_front_page <- function(label = "Front page", checkmate::assert_list(tables, types = "data.frame", names = "named", any.missing = FALSE) checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html")) checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE) - checkmate::assert_flag(show_metadata) if (!missing(show_metadata)) { lifecycle::deprecate_soft( when = "0.4.0", diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 58d0746f5..a303823e1 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -81,8 +81,8 @@ #' @export #' tm_variable_browser <- function(label = "Variable Browser", - datasets_selected = character(0), - datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, + datasets_selected = deprecated(), + datanames = if (missing(datasets_selected)) "all" else datasets_selected, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index f0da1e9f0..62c72e7e4 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -7,8 +7,8 @@ tm_data_table( label = "Data Table", variables_selected = list(), - datasets_selected = character(0), - datanames = if (!length(datasets_selected)) "all" else datasets_selected, + datasets_selected = deprecated(), + datanames = if (missing(datasets_selected)) "all" else datasets_selected, dt_args = list(), dt_options = list(searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), scrollX = TRUE), diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 2bd30efb8..9100a0bee 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -10,8 +10,8 @@ tm_front_page( tables = list(), additional_tags = tagList(), footnotes = character(0), - show_metadata = FALSE, - datanames = if (isTRUE(show_metadata)) "all" else NULL + show_metadata = deprecated(), + datanames = if (missing(show_metadata)) "all" else character(0) ) } \arguments{ diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index b5f5e5111..a0152c987 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index fcf07cdff..2025619c3 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -6,8 +6,8 @@ \usage{ tm_variable_browser( label = "Variable Browser", - datasets_selected = character(0), - datanames = if (length(datasets_selected) == 0) "all" else datasets_selected, + datasets_selected = deprecated(), + datanames = if (missing(datasets_selected)) "all" else datasets_selected, parent_dataname = "ADSL", pre_output = NULL, post_output = NULL, From 5fcca60d3ec3e13f0dc76e8f4c84b6f4ea92b4fd Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:57:14 +0000 Subject: [PATCH 36/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_g_distribution.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index a0152c987..b5f5e5111 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}) optional,\cr +\item{pre_output}{(\code{shiny.tag}, optional)\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} From 6faefc91f2f7cb7d4c092a5de5ffedb07ec2dc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 09:52:54 +0100 Subject: [PATCH 37/56] Use NULL as character0 is not accepted by teal::module(datanames) --- R/tm_front_page.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 6153c5ba9..e6c2847e7 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -72,7 +72,7 @@ tm_front_page <- function(label = "Front page", additional_tags = tagList(), footnotes = character(0), show_metadata = deprecated(), - datanames = if (missing(show_metadata)) "all" else character(0)) { + datanames = if (missing(show_metadata)) "all" else NULL) { message("Initializing tm_front_page") # Start of assertions From 3c4ddb53525c3c6822b9dc7e1281416330d1e6f4 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:12:14 +0000 Subject: [PATCH 38/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_front_page.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 9100a0bee..c18930200 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -11,7 +11,7 @@ tm_front_page( additional_tags = tagList(), footnotes = character(0), show_metadata = deprecated(), - datanames = if (missing(show_metadata)) "all" else character(0) + datanames = if (missing(show_metadata)) "all" else NULL ) } \arguments{ From 1a691ae97e9dbc761e44a1db9a8bda9bf5690832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 10:46:51 +0100 Subject: [PATCH 39/56] Add warning check (uncommited by error on last PR) --- tests/testthat/test-shinytest2-tm_data_table.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-shinytest2-tm_data_table.R b/tests/testthat/test-shinytest2-tm_data_table.R index e14d7dbec..b086590e1 100644 --- a/tests/testthat/test-shinytest2-tm_data_table.R +++ b/tests/testthat/test-shinytest2-tm_data_table.R @@ -100,7 +100,7 @@ test_that("e2e - tm_data_table: Verify default variable selection and set new se app_driver$stop() }) -test_that("e2e - tm_data_table: Verify error on datasets_selected", { +test_that("e2e - tm_data_table: Verify warning on deprecated datasets_selected", { skip_if_too_deep(5) app_driver <- function() { init_teal_app_driver( @@ -123,5 +123,5 @@ test_that("e2e - tm_data_table: Verify error on datasets_selected", { timeout = 3000 ) } - expect_error(app_driver()) + expect_warning(app_driver()) }) From d7fe39223dcc0976671bf735c961634ad0a46561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 11:37:41 +0100 Subject: [PATCH 40/56] Import and no reassign --- R/utils.R | 3 --- R/zzz.R | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/R/utils.R b/R/utils.R index 7adce8839..c1a8262eb 100644 --- a/R/utils.R +++ b/R/utils.R @@ -421,6 +421,3 @@ normalize_decorators <- function(decorators) { decorators } } - -#' @importFrom lifecycle deprecated -deprecated <- lifecycle::deprecated diff --git a/R/zzz.R b/R/zzz.R index 66210152b..2ccb87747 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -6,4 +6,5 @@ ### global variables ggplot_themes <- c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void") +#' @importFrom lifecycle deprecated interactive <- NULL From 2da5d0b466b6fcdebf2f9ebe9bc6b199a4627263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 11:41:39 +0100 Subject: [PATCH 41/56] Remove unnecessary NEWS entry --- NEWS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index a7cf97f2e..d85688eec 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,7 +7,6 @@ ### Enhancements * Added `teal.logger` functionality for logging changes in shiny inputs in all modules. -* Now all modules control which datasets are shown on the modules. ### Bug fixes * Fixed a bug in `tm_missing_data` in "Group by Subject" that was not using reactive data call. From ba2b03737bd9c98320fca90cd9635ad224493da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 11:42:35 +0100 Subject: [PATCH 42/56] Shorter datasets_selected argument and remove the datanames' argument of srv_page_data_table --- R/tm_data_table.R | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 904a2ea5a..c41956e5b 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -17,9 +17,7 @@ #' If no entry is specified for a dataset, the first six variables from that #' dataset will initially be shown. #' @param datasets_selected (`character`) `r lifecycle::badge("deprecated")` A vector of datasets which should be -#' shown and in what order. Names in the vector have to correspond with datasets names. -#' If vector of `length == 0` (default) then all datasets are shown. -#' Note: Only datasets of the `data.frame` class are compatible. +#' shown and in what order. Use `datanames` instead. #' @param dt_args (`named list`) Additional arguments to be passed to [DT::datatable()] #' (must not include `data` or `options`). #' @param dt_options (`named list`) The `options` argument to `DT::datatable`. By default @@ -139,7 +137,6 @@ tm_data_table <- function(label = "Data Table", datanames = datanames, server_args = list( variables_selected = variables_selected, - datanames = datanames, dt_args = dt_args, dt_options = dt_options, server_rendering = server_rendering @@ -188,7 +185,6 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) { # Server page module srv_page_data_table <- function(id, data, - datanames, variables_selected, dt_args, dt_options, @@ -206,10 +202,6 @@ srv_page_data_table <- function(id, is.data.frame(isolate(data())[[name]]) }, datanames) - if (!identical(datanames, character(0))) { - checkmate::assert_subset(datanames, datanames) - } - output$dataset_table <- renderUI({ do.call( tabsetPanel, From 53ac5be1102611f4eb2e45174fc6264280e6af1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 11:43:05 +0100 Subject: [PATCH 43/56] Use identical instead of != --- R/tm_missing_data.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 6de2bc607..2efedcdf7 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -162,7 +162,7 @@ tm_missing_data <- function(label = "Missing data", ans <- module( label, server = srv_page_missing_data, - datanames = if (all(datanames != "all")) union(datanames, parent_dataname) else "all", + datanames = if (identical(datanames, "all")) union(datanames, parent_dataname) else "all", server_args = list( parent_dataname = parent_dataname, plot_height = plot_height, From 6f08e3da9fb4087ffb958b616a8a1980066f13d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 11:44:14 +0100 Subject: [PATCH 44/56] Correct typo, shorten datases_selected argument's description, remove datanames argument. --- R/tm_variable_browser.R | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index a303823e1..9af7f64f7 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -10,14 +10,12 @@ #' @inheritParams teal::module #' @inheritParams shared_params #' @param parent_dataname (`character(1)`) string specifying a parent dataset. -#' If it exists in `datanames`then an extra checkbox will be shown to +#' If it exists in `datanames` then an extra checkbox will be shown to #' allow users to not show variables in other datasets which exist in this `dataname`. #' This is typically used to remove `ADSL` columns in `CDISC` data. #' In non `CDISC` data this can be ignored. Defaults to `"ADSL"`. -#' @param datasets_selected (`character`) `r lifecycle::badge("deprecated")` vector of datasets which should be -#' shown, in order. Names must correspond with datasets names. -#' If vector of length zero (default) then all datasets are shown. -#' Note: Only `data.frame` objects are compatible; using other types will cause an error. +#' @param datasets_selected (`character`) `r lifecycle::badge("deprecated")` vector of datasets to show, please +#' use the `datanames` argument. #' #' @inherit shared_params return #' @@ -127,7 +125,6 @@ tm_variable_browser <- function(label = "Variable Browser", ui = ui_variable_browser, datanames = if (all(datanames != "all")) union(datanames, parent_dataname) else "all", server_args = list( - datanames = datanames, parent_dataname = parent_dataname, ggplot2_args = ggplot2_args ), From cc70989a9484dea18b41e742a6fca7c9ad77ca90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 11:45:06 +0100 Subject: [PATCH 45/56] Update documentation with feedback and typos corrected --- man/tm_data_table.Rd | 4 +--- man/tm_g_distribution.Rd | 4 ++-- man/tm_variable_browser.Rd | 8 +++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index 62c72e7e4..20422a567 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -28,9 +28,7 @@ If no entry is specified for a dataset, the first six variables from that dataset will initially be shown.} \item{datasets_selected}{(\code{character}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} A vector of datasets which should be -shown and in what order. Names in the vector have to correspond with datasets names. -If vector of \code{length == 0} (default) then all datasets are shown. -Note: Only datasets of the \code{data.frame} class are compatible.} +shown and in what order. Use \code{datanames} instead.} \item{datanames}{(\code{character}) Names of the datasets relevant to the item. There are 2 reserved values that have specific behaviors: diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index b5f5e5111..a0152c987 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index 2025619c3..16604b31e 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -18,10 +18,8 @@ tm_variable_browser( \item{label}{(\code{character(1)}) Label shown in the navigation item for the module or module group. For \code{modules()} defaults to \code{"root"}. See \code{Details}.} -\item{datasets_selected}{(\code{character}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} vector of datasets which should be -shown, in order. Names must correspond with datasets names. -If vector of length zero (default) then all datasets are shown. -Note: Only \code{data.frame} objects are compatible; using other types will cause an error.} +\item{datasets_selected}{(\code{character}) \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} vector of datasets to show, please +use the \code{datanames} argument.} \item{datanames}{(\code{character}) Names of the datasets relevant to the item. There are 2 reserved values that have specific behaviors: @@ -33,7 +31,7 @@ argument. }} \item{parent_dataname}{(\code{character(1)}) string specifying a parent dataset. -If it exists in \code{datanames}then an extra checkbox will be shown to +If it exists in \code{datanames} then an extra checkbox will be shown to allow users to not show variables in other datasets which exist in this \code{dataname}. This is typically used to remove \code{ADSL} columns in \code{CDISC} data. In non \code{CDISC} data this can be ignored. Defaults to \code{"ADSL"}.} From 7bd66d59a25af82adf3f239652a2ccb1d202f428 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:52:10 +0000 Subject: [PATCH 46/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_g_distribution.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index a0152c987..b5f5e5111 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}) optional,\cr +\item{pre_output}{(\code{shiny.tag}, optional)\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} From 85452354ce2c529108d995bbef334b649d09cee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= <185338939+llrs-roche@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:00:22 +0100 Subject: [PATCH 47/56] Update R/tm_variable_browser.R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dawid Kałędkowski Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com> --- R/tm_variable_browser.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 9af7f64f7..ffdc86ed6 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -123,7 +123,7 @@ tm_variable_browser <- function(label = "Variable Browser", label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = if (all(datanames != "all")) union(datanames, parent_dataname) else "all", + datanames = if (identical(datanames, "all")) "all" else union(datanames, parent_dataname), server_args = list( parent_dataname = parent_dataname, ggplot2_args = ggplot2_args From c157c80bfca993dac0a51647afb7b655ffe80bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 14 Jan 2025 13:56:02 +0100 Subject: [PATCH 48/56] Remove tests --- .../testthat/test-shinytest2-tm_data_table.R | 26 --------------- .../testthat/test-shinytest2-tm_front_page.R | 28 ---------------- .../test-shinytest2-tm_variable_browser.R | 33 ------------------- 3 files changed, 87 deletions(-) diff --git a/tests/testthat/test-shinytest2-tm_data_table.R b/tests/testthat/test-shinytest2-tm_data_table.R index b086590e1..1b4bf3217 100644 --- a/tests/testthat/test-shinytest2-tm_data_table.R +++ b/tests/testthat/test-shinytest2-tm_data_table.R @@ -99,29 +99,3 @@ test_that("e2e - tm_data_table: Verify default variable selection and set new se app_driver$stop() }) - -test_that("e2e - tm_data_table: Verify warning on deprecated datasets_selected", { - skip_if_too_deep(5) - app_driver <- function() { - init_teal_app_driver( - data = simple_teal_data(), - modules = tm_data_table( - label = "Data Table", - variables_selected = list( - iris = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species") - ), - datasets_selected = c("iris", "mtcars"), - dt_args = list(caption = "Table Caption"), - dt_options = list( - searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), - scrollX = TRUE - ), - server_rendering = FALSE, - pre_output = NULL, - post_output = NULL - ), - timeout = 3000 - ) - } - expect_warning(app_driver()) -}) diff --git a/tests/testthat/test-shinytest2-tm_front_page.R b/tests/testthat/test-shinytest2-tm_front_page.R index 9ed5ccf12..febb35638 100644 --- a/tests/testthat/test-shinytest2-tm_front_page.R +++ b/tests/testthat/test-shinytest2-tm_front_page.R @@ -66,31 +66,3 @@ test_that("e2e - tm_front_page: Verify the module displays metadata", { app_driver$stop() }) -test_that("e2e - tm_front_page: Verify the module displays metadata", { - skip_if_too_deep(5) - app_driver_tm_front_page <- function() { - data <- simple_cdisc_data() - data <- within(data, { - attr(ADSL, "metadata") <- list("Author" = "NEST team", "data_source" = "synthetic data") - }) - - init_teal_app_driver( - data = data, - modules = tm_front_page( - label = "Front page", - header_text = c( - "Important information" = "It can go here.", - "Other information" = "Can go here." - ), - tables = list("MTCARS" = head(mtcars, 5), "IRIS" = head(iris, 5)), - additional_tags = HTML("Additional HTML or shiny tags go here"), - footnotes = "This is a footnote", - show_metadata = TRUE - ), - timeout = 3000 - ) - } - - # show metadata - testthat::expect_error(app_driver_tm_front_page()) -}) diff --git a/tests/testthat/test-shinytest2-tm_variable_browser.R b/tests/testthat/test-shinytest2-tm_variable_browser.R index 1aca5dddc..76b26b04e 100644 --- a/tests/testthat/test-shinytest2-tm_variable_browser.R +++ b/tests/testthat/test-shinytest2-tm_variable_browser.R @@ -220,36 +220,3 @@ testthat::test_that("e2e - tm_variable_browser: changing plot setting encodings app_driver$stop() }) - - -test_that("e2e - tm_variable_browser: Verify error on datasets_selected", { - skip_if_too_deep(5) - app_driver_tm_variable_browser <- function() { - # general data example - data <- within( - teal.data::teal_data(), - { - iris <- iris - mtcars <- mtcars - women <- women - faithful <- faithful - CO2 <- CO2 # nolint: object_name. - } - ) - - init_teal_app_driver( - data = data, - modules = tm_variable_browser( - label = "Variable browser (e2e)", - datasets_selected = c("iris", "mtcars", "women", "faithful", "CO2"), - parent_dataname = "CO2", - ggplot2_args = teal.widgets::ggplot2_args( - labs = list(subtitle = "Plot generated by Variable Browser Module") - ), - pre_output = shiny::tags$div("A pre-output message for tm_variable_browser"), - post_output = shiny::tags$div("A post-output message for tm_variable_browser") - ) - ) - } - expect_error(app_driver_tm_variable_browser()) -}) From 4b2eba247cd57dfcf23a477705862a3e0e94550a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 16 Jan 2025 12:41:47 +0100 Subject: [PATCH 49/56] Set parent_dataname that matches data available --- R/tm_missing_data.R | 2 +- man/tm_missing_data.Rd | 6 +++--- tests/testthat/test-shinytest2-tm_misssing_data.R | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 2efedcdf7..b2c434ca0 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -73,7 +73,7 @@ #' app <- init( #' data = data, #' modules = modules( -#' tm_missing_data() +#' tm_missing_data(parent_dataname = "mtcars") #' ) #' ) #' if (interactive()) { diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index cc9bd6d62..34d5ed6c0 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -131,7 +131,7 @@ data <- within(data, { app <- init( data = data, modules = modules( - tm_missing_data() + tm_missing_data(parent_dataname = "mtcars") ) ) if (interactive()) { @@ -162,8 +162,8 @@ if (interactive()) { \section{Examples in Shinylive}{ \describe{ \item{example-1}{ - \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEulIQatS6cKGwqCK6-FCkUEr9gwbGXNQA+iNQNsMDUGO6AO60pAAWKuwz0SBKurme3r6toqTE1ESM9fu6UPz8k9CiS2YWmtahtnsQBwehwFE3RE7FEnkm3BIEnYX2iJkuV3YIlKGxhtgAVLlzLQTOwAIzRDAABgArIS8QB2OTUgC6SwAcgBBW7-W4AXyUtx8tBeRl03NEtxg5xYvOMwoIos5v35QVEwDpfOK6ES7AF0Xuj2e9QOEtFCqWyp6HD1jFEGoeTygoh1ulN8uA-gIrGo-hpiuM1owJnUpER9uAjsILrdNNtAaDUhYoaWXp9Gn9IrNgf8UcYofqbJu0HQSxUaz8MpmNR2QoEwjENT4QhEokLf10pBgkxgPNEKgk0wWcxl9XqON0atUzEsOhs31uok2EFYjPQ7DQqAAJN4Negl2DGDprkoORAwGyaUA}{Open in Shinylive} - \if{html}{\out{}} + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEulIQatS6cKGwqCK6-FCkUEr9gwbGXNQA+iNQNsMDUGO6AO60pAAWKuwz0SBKurme3r6toqTE1ESM9fu6UPz8k9CiS2YWmtahtnsQBwehwFE3RE7FEnkm3BIEnYX2iJkuV3YIlKGxhtgAVLlzLQTOwAIzRDAABgArIS8QB2OTUgC6SwAcgBBW7-W4AXyUtx8tBeRl03NEtxg5xYvOMwoIos5v35QVEwDpfOK6ES7AF0Xuj2e9QOEtFCqWyp6HD1jFEGoeTygoh1ulN8uA-gIrGo-hpiuM1owJnUpER9uAjsILrdNNtAaDUhYoaWXp9Gn9IrNgf8UcYofqbJu0HQSxUaz8MpmNR2QoEwjENT4QhEokLf10pBgkxgPNEKgk0wW7FQLAopC7g2g8AOqX89v8tvq9RxujVqmYlh0Nm+t1EmwgrEZ6HYaFQABJvBr0PuwYwdNclByIGA2TSgA}{Open in Shinylive} + \if{html}{\out{}} \if{html}{\out{}} } \item{example-2}{ diff --git a/tests/testthat/test-shinytest2-tm_misssing_data.R b/tests/testthat/test-shinytest2-tm_misssing_data.R index debfcc1b1..96d151bd3 100644 --- a/tests/testthat/test-shinytest2-tm_misssing_data.R +++ b/tests/testthat/test-shinytest2-tm_misssing_data.R @@ -19,7 +19,7 @@ app_driver_tm_missing_data <- function() { label = "Missing data", plot_height = c(600, 400, 5000), plot_width = NULL, - parent_dataname = "", + datanames = "mtcars", ggtheme = "gray", ggplot2_args = list( "Combinations Hist" = teal.widgets::ggplot2_args( From d28c9343ac604fb7de5338987802ea15987009ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 16 Jan 2025 12:42:19 +0100 Subject: [PATCH 50/56] Documentation update --- man/srv_decorate_teal_data.Rd | 4 ++-- man/tm_g_distribution.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/srv_decorate_teal_data.Rd b/man/srv_decorate_teal_data.Rd index 18201124e..91977f9b9 100644 --- a/man/srv_decorate_teal_data.Rd +++ b/man/srv_decorate_teal_data.Rd @@ -10,9 +10,9 @@ srv_decorate_teal_data(id, data, decorators, expr, expr_is_reactive = FALSE) ui_decorate_teal_data(id, decorators, ...) } \arguments{ -\item{id}{(\code{character(1)}) Module id} +\item{id}{(\code{character(1)}) \code{shiny} module instance id.} -\item{data}{(\verb{reactive teal_data})} +\item{data}{(\code{reactive} returning \code{teal_data})} \item{expr}{(\code{expression} or \code{reactive}) to evaluate on the output of the decoration. When an expression it must be inline code. See \code{\link[=within]{within()}} diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index b5f5e5111..a0152c987 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} From 29662928ec46d6f663642bc8a1d0aff9bbc4b82c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:00:23 +0000 Subject: [PATCH 51/56] [skip style] [skip vbump] Restyle files --- R/tm_missing_data.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index b2c434ca0..42c23d91a 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -73,7 +73,7 @@ #' app <- init( #' data = data, #' modules = modules( -#' tm_missing_data(parent_dataname = "mtcars") +#' tm_missing_data(parent_dataname = "mtcars") #' ) #' ) #' if (interactive()) { From 999bdbdc3db5e87954b7c2cff766e6584e63a79b Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:07:13 +0000 Subject: [PATCH 52/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_g_distribution.Rd | 4 ++-- man/tm_missing_data.Rd | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index a0152c987..b5f5e5111 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}) optional,\cr +\item{pre_output}{(\code{shiny.tag}, optional)\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index 34d5ed6c0..1fbde12f9 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -131,7 +131,7 @@ data <- within(data, { app <- init( data = data, modules = modules( - tm_missing_data(parent_dataname = "mtcars") + tm_missing_data(parent_dataname = "mtcars") ) ) if (interactive()) { @@ -162,8 +162,8 @@ if (interactive()) { \section{Examples in Shinylive}{ \describe{ \item{example-1}{ - \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEulIQatS6cKGwqCK6-FCkUEr9gwbGXNQA+iNQNsMDUGO6AO60pAAWKuwz0SBKurme3r6toqTE1ESM9fu6UPz8k9CiS2YWmtahtnsQBwehwFE3RE7FEnkm3BIEnYX2iJkuV3YIlKGxhtgAVLlzLQTOwAIzRDAABgArIS8QB2OTUgC6SwAcgBBW7-W4AXyUtx8tBeRl03NEtxg5xYvOMwoIos5v35QVEwDpfOK6ES7AF0Xuj2e9QOEtFCqWyp6HD1jFEGoeTygoh1ulN8uA-gIrGo-hpiuM1owJnUpER9uAjsILrdNNtAaDUhYoaWXp9Gn9IrNgf8UcYofqbJu0HQSxUaz8MpmNR2QoEwjENT4QhEokLf10pBgkxgPNEKgk0wW7FQLAopC7g2g8AOqX89v8tvq9RxujVqmYlh0Nm+t1EmwgrEZ6HYaFQABJvBr0PuwYwdNclByIGA2TSgA}{Open in Shinylive} - \if{html}{\out{}} + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEulIQatS6cKGwqCK6-FCkUEr9gwbGXNQA+iNQNsMDUGO6AO60pAAWKuwz0SBKurme3r6toqTE1ESM9fu6UPz8k9CiS2YWmtahtnsQBwehwFE3RE7FEnkm3BIEnYX2iJkuV3YIlKGxhtgAVLlzLQTOwAIzRDAABgArIS8QB2OTUgC6SwAcgBBW7-W4AXyUtx8tBeRl03NEtxg5xYvOMwoIos5v35QVEwDpfOK6ES7AF0Xuj2e9QOEtFCqWyp6HD1jFEGoeTygoh1ulN8uA-gIrGo-hpiuM1owJnUpER9uAjsILrdNNtAaDUhYoaWXp9Gn9IrNgf8UcYofqbJu0HQSxUaz8MpmNR2QoEwjENT4QhEokLf10pBgkxgPNEKgk0wW7FQLAopC7g2g8Bq-nt-lt9XqON0atUzEsOhs31uok2EFYjPQ7DQqAAJN4Neg92DGDprkoORAwGyaUA}{Open in Shinylive} + \if{html}{\out{}} \if{html}{\out{}} } \item{example-2}{ From cdfe6f7526b4dc6033484800b16266fc447f4ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 17 Jan 2025 09:46:04 +0100 Subject: [PATCH 53/56] Keep order or datanames --- R/tm_data_table.R | 3 ++- R/tm_missing_data.R | 2 +- R/tm_variable_browser.R | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index c41956e5b..f18c5d05b 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -136,6 +136,7 @@ tm_data_table <- function(label = "Data Table", ui = ui_page_data_table, datanames = datanames, server_args = list( + datanames = datanames, variables_selected = variables_selected, dt_args = dt_args, dt_options = dt_options, @@ -185,6 +186,7 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) { # Server page module srv_page_data_table <- function(id, data, + datanames, variables_selected, dt_args, dt_options, @@ -197,7 +199,6 @@ srv_page_data_table <- function(id, if_filtered <- reactive(as.logical(input$if_filtered)) if_distinct <- reactive(as.logical(input$if_distinct)) - datanames <- isolate(names(data())) datanames <- Filter(function(name) { is.data.frame(isolate(data())[[name]]) }, datanames) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index b2c434ca0..42c23d91a 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -73,7 +73,7 @@ #' app <- init( #' data = data, #' modules = modules( -#' tm_missing_data(parent_dataname = "mtcars") +#' tm_missing_data(parent_dataname = "mtcars") #' ) #' ) #' if (interactive()) { diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index ffdc86ed6..e6a176f7a 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -118,13 +118,19 @@ tm_variable_browser <- function(label = "Variable Browser", checkmate::assert_class(ggplot2_args, "ggplot2_args") # End of assertions + datanames <- if (identical(datanames, "all")) { + "all" + } else { + union(datanames, parent_dataname) + } ans <- module( label, server = srv_variable_browser, ui = ui_variable_browser, - datanames = if (identical(datanames, "all")) "all" else union(datanames, parent_dataname), + datanames = datanames, server_args = list( + datanames = datanames, parent_dataname = parent_dataname, ggplot2_args = ggplot2_args ), @@ -231,7 +237,6 @@ srv_variable_browser <- function(id, varname_numeric_as_factor <- reactiveValues() - datanames <- isolate(names(data())) datanames <- Filter(function(name) { is.data.frame(isolate(data())[[name]]) }, datanames) From 7485958f4785027e3e080bad173b96335b619476 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:39:46 +0000 Subject: [PATCH 54/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_missing_data.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index b9006aa83..0969c1018 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -160,8 +160,8 @@ if (interactive()) { \section{Examples in Shinylive}{ \describe{ \item{example-1}{ - \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEulIQatS6cKGwqCK6-FCkUEr9gwbGXNQA+iNQNsMDUGO6AO60pAAWKuwz0SBKurme3r6toqTE1ESM9fu6UPz8k9CiS2YWmtahtnsQBwehwFE3RE7FEnkm3BIEnYX2iJkuV3YIlKGxhtgAVLlzLQTOwAIzRDAABgArIS8QB2OTUgC6SwAcgBBW7-W4AXyUtx8tBeRl03NEtxg5xYvOMwoIos5v35QVEwDpfOK6ES7AF0Xuj2e9QOEtFCqWyp6HD1jFEGoeTygoh1ulN8uA-gIrGo-hpiuM1owJnUpER9uAjsILrdNNtAaDUhYoaWXp9Gn9IrNgf8UcYofqbJu0HQSxUaz8MpmNR2QoEwjENT4QhEokLf10pBgkxgPNEKgk0wW7FQLAopC7g2g8Bq-nt-lt9XqON0atUzEsOhs31uok2EFYjPQ7DQqAAJN4Neg92DGDprkoORAwGyaUA}{Open in Shinylive} - \if{html}{\out{}} + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrquuAAesKgiuvxQpFBK4ZEGxlzUAPoxUDbREVBxugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQFbpQ-PyJ0KJZZhaa1gG25RCVlQHAosEi7KK1idwkEuyTpSbtHewiEBIF27YAVFXmtCbsAIylGAAMAKyPdwDsct8AulkAcgBBHpzHoAXzcM10DVowyM0MYsJ6MFaLDhxhRBDRkMqMNEwD+8OoaBCHDxpT6AyGXUqmLRBKyxPQ1A4dMYogp-UGUFENN0bPxwAUhFY1GFP0Jxh5GBM6lIBwFwCFIrFYAlfMVyqkLHFkt64llGgVqPZSuF2sYuq6YK6ShJWRUeXYPRSugAvGEMrhkQJhGJ3fzfSJRM6oZVSDBEjBYaIVBJkhl2KgWBRSAnItB4AHhQLhXyul0brp2CpyMxLDobFMeqJChBWID0OwSQASeoU9At1aMHSdJQQiBgME-IA}{Open in Shinylive} + \if{html}{\out{}} \if{html}{\out{}} } \item{example-2}{ From a561700a137ec76dd1fd8cf2d357e87e7e5c50fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 17 Jan 2025 16:33:15 +0100 Subject: [PATCH 55/56] Fix broken merge --- DESCRIPTION | 6 +++++- man/tm_g_distribution.Rd | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8137833a0..d422460b3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -42,7 +42,12 @@ Imports: ggrepel (>= 0.9.6), goftest (>= 1.2-3), grid, + gridExtra (>= 2.3), + htmlwidgets (>= 1.6.4), + jsonlite (>= 1.8.9), + lattice (>= 0.18-4), lifecycle (>= 0.2.0), + MASS (>= 7.3-61), rlistings (>= 0.2.8), rtables (>= 0.6.8), scales (>= 1.3.0), @@ -65,7 +70,6 @@ Imports: utils Suggests: knitr (>= 1.42), - lattice (>= 0.18-4), logger (>= 0.2.0), nestcolor (>= 0.1.0), pkgload, diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index 545bd2447..b6575073e 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} From 0deb55e14afa8c84e65ad770ae0191449ee2ea66 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:42:19 +0000 Subject: [PATCH 56/56] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/tm_g_distribution.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index b6575073e..545bd2447 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -58,10 +58,10 @@ Defaults to \code{c(30L, 1L, 100L)}. \item{plot_width}{(\code{numeric}) optional, specifies the plot width as a three-element vector of \code{value}, \code{min}, and \code{max} for a slider encoding the plot width.} -\item{pre_output}{(\code{shiny.tag}) optional,\cr +\item{pre_output}{(\code{shiny.tag}, optional)\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{decorators}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}