From 05aeb65d00f86a3b78b77afab0296e50e83ae575 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:31:18 +0200 Subject: [PATCH] use roxy.shinylive (#775) test with https://github.com/insightsengineering/roxy.shinylive/pull/1 Implementation of `roxy.shinylive`. Please run `pkgdown::build_site()` to see the difference. ![image](https://github.com/user-attachments/assets/96283a55-5c2a-493f-a855-5ef17425ac34) Extra: - for a few examples: remove dependency on `teal.widgets` so that the example code is simpler - for a few examples: replace `@examples` with `@examplesIf`. This is for our incorrect implementation of soft dependencies - add a new "Playground" section in the README with links to the shinylive - include shinylive iframe in the vignettes --------- Signed-off-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .gitignore | 2 ++ DESCRIPTION | 5 +-- R/tm_a_pca.R | 17 +++++----- R/tm_a_regression.R | 19 ++++++----- R/tm_data_table.R | 9 ++++++ R/tm_file_viewer.R | 4 +++ R/tm_front_page.R | 4 +++ R/tm_g_association.R | 17 +++++----- R/tm_g_bivariate.R | 18 +++++------ R/tm_g_distribution.R | 23 ++++++++------ R/tm_g_response.R | 19 ++++++----- R/tm_g_scatterplot.R | 23 ++++++++------ R/tm_g_scatterplotmatrix.R | 11 ++++++- R/tm_missing_data.R | 31 +++++++++--------- R/tm_outliers.R | 21 ++++++------ R/tm_t_crosstable.R | 21 ++++++------ R/tm_variable_browser.R | 38 ++++++++++++++-------- README.md | 7 ++++ inst/WORDLIST | 1 + man/tm_a_pca.Rd | 23 +++++++++----- man/tm_a_regression.Rd | 25 +++++++++------ man/tm_data_table.Rd | 15 +++++++++ man/tm_file_viewer.Rd | 10 ++++++ man/tm_front_page.Rd | 10 ++++++ man/tm_g_association.Rd | 23 +++++++++----- man/tm_g_bivariate.Rd | 24 ++++++++------ man/tm_g_distribution.Rd | 29 +++++++++++------ man/tm_g_response.Rd | 25 +++++++++------ man/tm_g_scatterplot.Rd | 29 +++++++++++------ man/tm_g_scatterplotmatrix.Rd | 21 ++++++++++-- man/tm_missing_data.Rd | 41 ++++++++++++++---------- man/tm_outliers.Rd | 27 +++++++++------- man/tm_t_crosstable.Rd | 31 +++++++++++------- man/tm_variable_browser.Rd | 44 ++++++++++++++++++-------- staged_dependencies.yaml | 3 ++ vignettes/teal-modules-general.Rmd | 31 ++++++++++++++---- vignettes/using-association-plot.Rmd | 26 ++++++++++++--- vignettes/using-bivariate-plot.Rmd | 26 ++++++++++++--- vignettes/using-cross-table.Rmd | 27 +++++++++++++--- vignettes/using-data-table.Rmd | 30 ++++++++++++++---- vignettes/using-outliers-module.Rmd | 30 ++++++++++++++---- vignettes/using-regression-plots.Rmd | 26 ++++++++++++--- vignettes/using-response-plot.Rmd | 26 ++++++++++++--- vignettes/using-scatterplot-matrix.Rmd | 27 +++++++++++++--- vignettes/using-scatterplot.Rmd | 35 ++++++++++++++------ 45 files changed, 663 insertions(+), 291 deletions(-) diff --git a/.gitignore b/.gitignore index fb00dbe32..1657ceda4 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ vignettes/*.R coverage.* tests/testthat/_snaps/**/*.new.md tests/testthat/_snaps/**/*.new.svg +/doc/ +/Meta/ diff --git a/DESCRIPTION b/DESCRIPTION index aff6d9374..8b91d2565 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -71,6 +71,7 @@ Suggests: pkgload, rlang (>= 1.0.0), rmarkdown (>= 2.23), + roxy.shinylive, rtables (>= 0.6.8), rvest, shinytest2, @@ -92,12 +93,12 @@ Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2, aphalo/ggpmisc, aphalo/ggpp, slowkow/ggrepel, baddstats/goftest, ramnathv/htmlwidgets, jeroen/jsonlite, yihui/knitr, daroczig/logger, deepayan/lattice, insightsengineering/nestcolor, r-lib/pkgload, - r-lib/rlang, rstudio/rmarkdown, insightsengineering/rtables, + r-lib/rlang, rstudio/rmarkdown, insightsengineering/roxy.shinylive, insightsengineering/rtables, tidyverse/rvest, htmlwidgets/sparkline, rstudio/shinytest2, r-lib/testthat, r-lib/withr Config/Needs/website: insightsengineering/nesttemplate Encoding: UTF-8 Language: en-US LazyData: true -Roxygen: list(markdown = TRUE) +Roxygen: list(markdown = TRUE, packages = c("roxy.shinylive")) RoxygenNote: 7.3.2 diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index b2c0a1a2e..53996ebb7 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -18,9 +18,11 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples -#' library(teal.widgets) -#' #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -45,9 +47,6 @@ #' multiple = TRUE #' ), #' filter = NULL -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by PCA Module") #' ) #' ) #' ) @@ -56,6 +55,11 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example #' data <- teal_data() #' data <- within(data, { @@ -80,9 +84,6 @@ #' multiple = TRUE #' ), #' filter = NULL -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by PCA Module") #' ) #' ) #' ) diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index a941e5e20..89406f5e5 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -42,10 +42,12 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples #' # general data example -#' library(teal.widgets) -#' #' data <- teal_data() #' data <- within(data, { #' require(nestcolor) @@ -77,9 +79,6 @@ #' multiple = TRUE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Regression Module") #' ) #' ) #' ) @@ -88,9 +87,12 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example -#' library(teal.widgets) -#' #' data <- teal_data() #' data <- within(data, { #' require(nestcolor) @@ -123,9 +125,6 @@ #' multiple = TRUE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Regression Module") #' ) #' ) #' ) diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 2d215f8c9..4a2be49d4 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -29,6 +29,10 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples #' # general data example #' data <- teal_data() @@ -53,6 +57,11 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example #' data <- teal_data() #' data <- within(data, { diff --git a/R/tm_file_viewer.R b/R/tm_file_viewer.R index 3b96185bb..772dfdac3 100644 --- a/R/tm_file_viewer.R +++ b/R/tm_file_viewer.R @@ -13,6 +13,10 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples #' data <- teal_data() #' data <- within(data, { diff --git a/R/tm_front_page.R b/R/tm_front_page.R index fbffb8769..7304eb90c 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -17,6 +17,10 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples #' data <- teal_data() #' data <- within(data, { diff --git a/R/tm_g_association.R b/R/tm_g_association.R index b0611490c..c3698f5d8 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -25,9 +25,11 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples -#' library(teal.widgets) -#' #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -60,9 +62,6 @@ #' multiple = TRUE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Association Module") #' ) #' ) #' ) @@ -71,6 +70,11 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example #' data <- teal_data() #' data <- within(data, { @@ -108,9 +112,6 @@ #' multiple = TRUE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Association Module") #' ) #' ) #' ) diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 807b4f23b..bf9358476 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -46,9 +46,11 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples -#' library(teal.widgets) -#' #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -96,9 +98,6 @@ #' selected = "Treatment", #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Bivariate Module") #' ) #' ) #' ) @@ -106,7 +105,11 @@ #' shinyApp(app$ui, app$server) #' } #' -#' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example #' data <- teal_data() #' data <- within(data, { @@ -155,9 +158,6 @@ #' selected = "COUNTRY", #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Bivariate Module") #' ) #' ) #' ) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 1361e3504..6b6192678 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -27,9 +27,13 @@ #' #' @inherit shared_params return #' -#' @examples -#' library(teal.widgets) -#' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +# nolint start: line_length_linter. +#' @examplesIf require("ggpmisc", quietly = TRUE) && require("ggpp", quietly = TRUE) && require("goftest", quietly = TRUE) && require("MASS", quietly = TRUE) && require("broom", quietly = TRUE) +# nolint end: line_length_linter. #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -44,9 +48,6 @@ #' dist_var = data_extract_spec( #' dataname = "iris", #' select = select_spec(variable_choices("iris"), "Petal.Length") -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Distribution Module") #' ) #' ) #' ) @@ -55,6 +56,13 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +# nolint start: line_length_linter. +#' @examplesIf require("ggpmisc", quietly = TRUE) && require("ggpp", quietly = TRUE) && require("goftest", quietly = TRUE) && require("MASS", quietly = TRUE) && require("broom", quietly = TRUE) +# nolint end: line_length_linter. #' # CDISC data example #' data <- teal_data() #' data <- within(data, { @@ -94,9 +102,6 @@ #' vars = vars1, #' multiple = TRUE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Distribution Module") #' ) #' ) #' ) diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 44daa300d..35ee6d36a 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -39,10 +39,12 @@ #' @note For more examples, please see the vignette "Using response plot" via #' `vignette("using-response-plot", package = "teal.modules.general")`. #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples #' # general data example -#' library(teal.widgets) -#' #' data <- teal_data() #' data <- within(data, { #' require(nestcolor) @@ -77,9 +79,6 @@ #' multiple = FALSE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Response Module") #' ) #' ) #' ) @@ -88,9 +87,12 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example -#' library(teal.widgets) -#' #' data <- teal_data() #' data <- within(data, { #' require(nestcolor) @@ -123,9 +125,6 @@ #' multiple = FALSE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Response Module") #' ) #' ) #' ) diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index 066ee5506..d093a4fad 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -30,9 +30,13 @@ #' #' @inherit shared_params return #' -#' @examples -#' library(teal.widgets) -#' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +# nolint start: line_length_linter. +#' @examplesIf require("ggpmisc", quietly = TRUE) && require("ggExtra", quietly = TRUE) && require("colourpicker", quietly = TRUE) +# nolint end: line_length_linter. #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -108,9 +112,6 @@ #' multiple = FALSE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Scatterplot Module") #' ) #' ) #' ) @@ -119,6 +120,13 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +# nolint start: line_length_linter. +#' @examplesIf require("ggpmisc", quietly = TRUE) && require("ggExtra", quietly = TRUE) && require("colourpicker", quietly = TRUE) +# nolint end: line_length_linter. #' # CDISC data example #' data <- teal_data() #' data <- within(data, { @@ -195,9 +203,6 @@ #' multiple = FALSE, #' fixed = FALSE #' ) -#' ), -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Scatterplot Module") #' ) #' ) #' ) diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index e8c7ce3b9..a570bf6bb 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -18,7 +18,11 @@ #' #' @inherit shared_params return #' -#' @examples +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examplesIf require("lattice", quietly = TRUE) #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -102,6 +106,11 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examplesIf require("lattice", quietly = TRUE) #' # CDISC data example #' data <- teal_data() #' data <- within(data, { diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 7af029e74..7f026cb49 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -17,19 +17,11 @@ #' #' @inherit shared_params return #' -#' @examples -#' library(teal.widgets) -#' -#' # module specification used in apps below -#' tm_missing_data_module <- tm_missing_data( -#' ggplot2_args = list( -#' "Combinations Hist" = ggplot2_args( -#' labs = list(subtitle = "Plot produced by Missing Data Module", caption = NULL) -#' ), -#' "Combinations Main" = ggplot2_args(labs = list(title = NULL)) -#' ) -#' ) -#' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examplesIf require("gridExtra", quietly = TRUE) && require("rlang", quietly = TRUE) #' # general example data #' data <- teal_data() #' data <- within(data, { @@ -52,12 +44,19 @@ #' #' app <- init( #' data = data, -#' modules = modules(tm_missing_data_module) +#' modules = modules( +#' tm_missing_data() +#' ) #' ) #' if (interactive()) { #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examplesIf require("gridExtra", quietly = TRUE) && require("rlang", quietly = TRUE) #' # CDISC example data #' data <- teal_data() #' data <- within(data, { @@ -70,7 +69,9 @@ #' #' app <- init( #' data = data, -#' modules = modules(tm_missing_data_module) +#' modules = modules( +#' tm_missing_data() +#' ) #' ) #' if (interactive()) { #' shinyApp(app$ui, app$server) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index db3ce782d..03a43b18e 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -17,9 +17,11 @@ #' #' @inherit shared_params return #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} #' @examples -#' library(teal.widgets) -#' #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -57,11 +59,6 @@ #' multiple = TRUE #' ) #' ) -#' ), -#' ggplot2_args = list( -#' ggplot2_args( -#' labs = list(subtitle = "Plot generated by Outliers Module") -#' ) #' ) #' ) #' ) @@ -70,6 +67,11 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examples #' # CDISC data example #' data <- teal_data() #' data <- within(data, { @@ -107,11 +109,6 @@ #' multiple = TRUE #' ) #' ) -#' ), -#' ggplot2_args = list( -#' ggplot2_args( -#' labs = list(subtitle = "Plot generated by Outliers Module") -#' ) #' ) #' ) #' ) diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index d4e3b4700..9e4e8e62c 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -25,10 +25,12 @@ #' #' @inherit shared_params return #' -#' @examples +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examplesIf require("rtables", quietly = TRUE) #' # general data example -#' library(teal.widgets) -#' #' data <- teal_data() #' data <- within(data, { #' mtcars <- mtcars @@ -65,9 +67,6 @@ #' multiple = FALSE, #' fixed = FALSE #' ) -#' ), -#' basic_table_args = basic_table_args( -#' subtitles = "Table generated by Crosstable Module" #' ) #' ) #' ) @@ -76,9 +75,12 @@ #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +#' @examplesIf require("rtables", quietly = TRUE) #' # CDISC data example -#' library(teal.widgets) -#' #' data <- teal_data() #' data <- within(data, { #' ADSL <- rADSL @@ -117,9 +119,6 @@ #' multiple = FALSE, #' fixed = FALSE #' ) -#' ), -#' basic_table_args = basic_table_args( -#' subtitles = "Table generated by Crosstable Module" #' ) #' ) #' ) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index c4b7ae6c8..28e0c11d1 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -21,17 +21,13 @@ #' #' @inherit shared_params return #' -#' @examples -#' library(teal.widgets) -#' -#' # Module specification used in apps below -#' tm_variable_browser_module <- tm_variable_browser( -#' label = "Variable browser", -#' ggplot2_args = ggplot2_args( -#' labs = list(subtitle = "Plot generated by Variable Browser Module") -#' ) -#' ) -#' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +# nolint start: line_length_linter. +#' @examplesIf require("sparkline", quietly = TRUE) && require("htmlwidgets", quietly = TRUE) && require("jsonlite", quietly = TRUE) +# nolint end: line_length_linter. #' # general data example #' data <- teal_data() #' data <- within(data, { @@ -45,13 +41,25 @@ #' #' app <- init( #' data = data, -#' modules = modules(tm_variable_browser_module) +#' modules = modules( +#' tm_variable_browser( +#' label = "Variable browser" +#' ) +#' ) #' ) #' if (interactive()) { #' shinyApp(app$ui, app$server) #' } #' +#' @examplesShinylive +#' library(teal.modules.general) +#' interactive <- function() TRUE +#' {{ next_example }} +# nolint start: line_length_linter. +#' @examplesIf require("sparkline", quietly = TRUE) && require("htmlwidgets", quietly = TRUE) && require("jsonlite", quietly = TRUE) +# nolint end: line_length_linter. #' # CDISC example data +#' library(sparkline) #' data <- teal_data() #' data <- within(data, { #' ADSL <- rADSL @@ -62,7 +70,11 @@ #' #' app <- init( #' data = data, -#' modules = modules(tm_variable_browser_module) +#' modules = modules( +#' tm_variable_browser( +#' label = "Variable browser" +#' ) +#' ) #' ) #' if (interactive()) { #' shinyApp(app$ui, app$server) diff --git a/README.md b/README.md index 56a13a866..b60732686 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,13 @@ pak::pak("insightsengineering/teal.modules.general") To understand how to use this package, please refer to the [Getting Started](https://insightsengineering.github.io/teal.modules.general/latest-tag/articles/teal-modules-general.html) article, which provides multiple examples of code implementation. +## Playground + +You can try out the package without installing it in the Shinylive: + +* [stable](https://shinylive.io/r/editor/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCGAC+AXSA) +* [development](https://shinylive.io/r/editor/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMI1UgSxIGcAKAdzgCMAnAfVQGsA5jy5xURRgAIAvJILMAOmC4BaAK4Q6ANzhdGcJTMlKAFqVKpGiAPTXUJqFxhQdeuBlUbtu-RgAmcFpKuJKCcKQA8rQMEIpg7Nx8QiJiEkoAlJkKEAA2dNyOAJ7M5FA5GDBEfmo5cIwYYRC6ZenZYAC+ALpAA) + ## Getting help If you encounter a bug or have a feature request, please file an issue. For questions, discussions, and staying up to date, please use the `teal` channel in the [`pharmaverse` slack workspace](https://pharmaverse.slack.com). diff --git a/inst/WORDLIST b/inst/WORDLIST index e77494d7b..d00a0162f 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,6 +1,7 @@ Forkers Hoffmann Prebuilt +Shinylive TLG UI customizable diff --git a/man/tm_a_pca.Rd b/man/tm_a_pca.Rd index a4fa1e679..0c3613ac4 100644 --- a/man/tm_a_pca.Rd +++ b/man/tm_a_pca.Rd @@ -83,8 +83,6 @@ Additionally, it enables dynamic customization of plot aesthetics, such as opaci font size, through UI inputs. } \examples{ -library(teal.widgets) - # general data example data <- teal_data() data <- within(data, { @@ -109,9 +107,6 @@ app <- init( multiple = TRUE ), filter = NULL - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by PCA Module") ) ) ) @@ -144,9 +139,6 @@ app <- init( multiple = TRUE ), filter = NULL - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by PCA Module") ) ) ) @@ -156,3 +148,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQlY4AygCCjNUtonG6fYPDpKJKAL5d6UHQ8KLFGbZZCmATQ2LTW27Q6GMqeewV-hm6ALyXQbgXfEIio7dPwmLn3ZW6pDCJUESqAIqQuP10WwACgBhfpbB7fcExG53QFhUjMDSJUSoOAEL7gpEZZZ6W5bHZTGZ4MGE0RwEQaFF0hmkbG4-E0wm6Aj5Ii0AhiFFaFi0KD0ESJHl8gWrTlc1EolLAYDkga7EZbAC6mtKHLAAFlBIx+DJ4RCwP1RKIoMJSGbyYx6FAIJCiKh7WAsGg4FsuvKfnIEf7Ksy8eR+Ci9Ybjaa8ObLdbbb6g8GYLbaJFSfYnK5EYTA3LKiZaNRyIwUQA5RwAGWrcr9AYuXS6tBMunYKjL6k0OhstnK31EhQgrH66HYaFQABJ6qVJ1O6YwdJ05kowLNNUA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWT64bGlAF9+zOh4UQrc23yFMCnRjaUAKyIVNIBrOFZlzLXjfjgTKGFSNIJ+WlECNP3Dk7PgBdgxFfCcgAum5oOgJipiuxaiFcroALyw8K4GF8IQiUQI3Ro4T-GF1UgwNJQNKoAhZfF1XQbAAKXkGGxRAypdUSWMyaWipGYGjSolQcAI0OZLNZuUWekRGy2jMpLNEcBEGixCqVD35guFotFBBKBwIYixWhYtCg9BEjz1tANyzl2qREURmWAwGlI22YCBQKqQo2ACEALJYADSWAAjIzqZsAOKuPBR5wAeQCPgAmht+vaqXImVm6qrBeR+FjfWBAyHw5HpbGM7m8zB7rQ4pL7E5XCLRTm7XUTLRqORGFiAHKOUbbDt1TPZmH9fq0Ey6dgqAfqTQ6Gy2GrM0RlCCsQbodhoVAAEhaVWPJ4VjB0fVmSjAMyBQA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_a_regression.Rd b/man/tm_a_regression.Rd index dc4f458f3..40a1679c0 100644 --- a/man/tm_a_regression.Rd +++ b/man/tm_a_regression.Rd @@ -112,8 +112,6 @@ For more examples, please see the vignette "Using regression plots" via } \examples{ # general data example -library(teal.widgets) - data <- teal_data() data <- within(data, { require(nestcolor) @@ -145,9 +143,6 @@ app <- init( multiple = TRUE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Regression Module") ) ) ) @@ -157,8 +152,6 @@ if (interactive()) { } # CDISC data example -library(teal.widgets) - data <- teal_data() data <- within(data, { require(nestcolor) @@ -191,9 +184,6 @@ app <- init( multiple = TRUE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Regression Module") ) ) ) @@ -203,3 +193,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQlQDCAPIATHG6-QNKAL5dKdDwosUZtlkE7Apgo6tdSmiowyp5K93+GboAvEdBuBW6fEIioqfXAsJiB5WVpDCJUInVEtWioisEFeb0q1Cg9DgfjOqywcD+YkBJFWl0OoP+qBIoj0ZxSiTCpGYGkSolQcGWV1BlWmsBxulW6zwlKp2JEGgerPJpBJZIpaKpYIhUIeqwAylCubotCxaBCRIgUcyBQR8kRaAQxCKwIJUEEANZwRX8gWcjRwfhanX6w1M41UmDCTSROkAMQAggAZUXOVEC0EmWihc0PBwuJVvLoCuS+qm-f6iDoPPEEonc0nkkECmnwLWMmMmiXss6mtO8zN+8GQ6H0sDitmkKUyuViBW2v1vFVqjX3M7Sxiy+giRKd9UvFLAYAMwarAC6M9KFMIJAIKJrdmqgXgZA20fDoJLwZhS4sRvblQd1CdIhDTh9e7eAaDFrO7q9rjtlUjVK-n6uXS6tAmLo7AqOQqbaHANi2OUhyiIUECsG66DsNsAAk9SlGh2KMDonQTEoYDjDOQA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWT64bGlAF9+zOh4UQrc23yFMCnRjaUAKyIVNIBrOFZlzLXjfjgTKGFSNIJ+WlECNP3Dk7PgBdgxFfCcgAum5oOgJipiuxaiFcroALyw8K4GF8IQiUQI3Ro4T-GF1UgwNJQNINCQNUSiKwQaEDOr06hQehwahYjZYODksRUkgbFF0+n1MSoEiiPSIzJpaKkZgaNKiVBwAi0wWC37wNmbEbbPD41VikQaLEGpUPBVKlWqwWM5msxEbAIs026LQsWhMkSIPl6q0EEoHAhiTUAIQAslgANJYACM3oFVt0Jo0cH4IfDUdjuvjVpg91ocXFugAYoNRgFnPyE-STLQoimsQ4XD76f0rXJK6qyRTRL0sZLpbKzYrlc26urCxstnGq0nSManXLzSPs6qbSzNY7DXPXYx3fQMV6s1W6n6A0HETu9yJHv7aIHzrlgMBJ9qNkCgVUR5sAOKuPC6B1nAADT5ACwCwQYvD-OR21HelZ3re0fz-Dsq1zahNALBsnArOC6hrOtU0REsy1cFc6lbVVKIomF+n6WgTF0dgVHIQdtDgGxbBqOlRDKCBWEGdB2DQVAABIWiqETRLFRgdD6WYlDAGYgSAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_data_table.Rd b/man/tm_data_table.Rd index 1d24f04b1..8f0f9ff07 100644 --- a/man/tm_data_table.Rd +++ b/man/tm_data_table.Rd @@ -108,3 +108,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQlQ20onG6vaJKAL5dKdDwosUZtlkE7ApgQ0tdSmioAyp5i93+GboAvPtBuBW6fEIi-ceXwmK7lZWkMMkZiUH0Io9PlVostCgXzEiVEcBEGjg-COujoLR+vx6jD6MIWSwAynBUNwMAAZCgSApLUoYrE4gDqtH4RLwuiWAAU4EEePiIIT8sS6WBGcyMJTqRzaRjUHACLQxKtzr85Gc9r9qYkWBIbrC+qR2AQ0JoSDClgBJLB69H2IEiXQAYS1Vggkrlui6lS6XVoJl07BU5GYlh0Nls5T2okKEFYAEF0OwNgASeqlKNgxg6TqjJRgEYAXSAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWT64bGlAF9+zOh4UQrc23yFMCnRjaUAKyIVNIBrOFZlzLXjfjgTKGFSNIJ+WlECNP3Dk7PgBdgxFfCcgAum5oOgJipiuxaiFcroALyw8K4GF8IQiUQI3Ro4T-GF1UgwDK5NLhegiaEDOrUrQsWhQcliNKiOAiDRwfhYuiiUjsLZYgjQsABOyOHwATT8Pg2VQ2jgCjgAQgApKUy3QbBUqtV4DXCvx2Zw62WbADirl1mucAA0NnI5CiqdSQg8WBJMYjubyCGhNCQsRt+XYGSJvL6rBA7fjdP06v1+rQTLp2CpyMxLDobLYalTRGUIKxBuh2GhUAASFpVUtllmMHR9WZKMAzIFAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_file_viewer.Rd b/man/tm_file_viewer.Rd index c04f73a2e..668b3cb4c 100644 --- a/man/tm_file_viewer.Rd +++ b/man/tm_file_viewer.Rd @@ -51,3 +51,13 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqX8opKAeNdqAfQ8vG3dPbyNdAHdaUgALFXYgqFxdECVdXSSfTLCME2Z4dgBGRQgAX1Kk6HhRRLDbCIJ2BTAkltKlNFRslRjmiAysgF4cr1x03T4hEVFdEanhMX6MjNIYfxNaEX8tWjhImWWVjJVUQVJ-VE9Yud06UVIj44yTImp+GVvRVge4GDytnBmmBRLBUNtNjMWikrgQANZQKS3Fp+XgCRbiKQQNTUdrjAbPDKoCASL4-cj-SFAlqgmDguAbQGiAD0tPpjJEGGJEmhulhCKRIxRcG4aOmYkk0lkeImhNIAA9SGTfpTAcC2RCmaywZrOQrSLz+Yi9EKwKiFjNJdjpWA5PjCRlBIxqMiwLFSKRUKJEMzmSYPJIiFo-Vr+IxBBIWWd6PdYnB+MyAApERheGNwQwAESIBEE8DIhgAYimYJ5DABlVBwAi0TYETxWCDiVD8EwtWUrUrHLu6UqlWu6dgqcjMSw6Gy2NIE0TxCCsACC6HYXQAJIJaClV6IZDpGKUykowGUALpAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_front_page.Rd b/man/tm_front_page.Rd index 801bbd00e..78e725ddc 100644 --- a/man/tm_front_page.Rd +++ b/man/tm_front_page.Rd @@ -82,3 +82,13 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqX8opKAeNdqAfQ8vG3dPbyNdAHdaUgALFXYgqFxdECVdXUY4AEdBWiz2CDFSYmoiRkUIDIBBABEAZQAZH0y6pvTdT1JGdjbGlIUweC8kwdsIulFSdkHqwTjywd0AXl1BgDlnertdLhhBgbAk-1EiQUYCOCXVwdFWMli4TQJdUbBKgF9KpOh4UUSwuNjLMGo1BkoAFZEFT+ADWcFY-ySQNecBMUGEpH8BH4tFEBH8UJh8MRwB+sDEAK8cgAum4yFB6CJ-ABGFpJDAmZjwdgASQgJiIK10BBmYGqBzWYAAQmMUnY4AAPUjC0WzSWDWXvSpeJlwfwAJnZYU53Lg7AABgBhIjUQQwKosi2qsVWjVgWpy3TW232qoG52rUUAVgwwZSADYMBG5CkfXaHboAMyBkViiV4KVauQ6xnMpPGrymil8gVCoNi1yZwYAMS9CuVLsGAHF3QAJMaVJS65kqVDzFqTaYdQZ2PN6FnXXbj1m4EdgMd63QGqc9-UGudVKWLkTJ1czpNKLvQdAtFQxGZbpLCpKbjJ8IQiUTCh-CSkdDKkGD+LkkLGoKApEvDIQN0R4oH4GR-HIRsKw-UCpV5GBUHKLwyF0FRBUYGBPCsCAp0GXkVQIKAqgkIVHiyDADng0DBgAeTiGQMLLbDcJIAiwCtUjdHIsCZDgaiwFo3RYxEtdn1WNd-D7eY7wQiDcU0EhuGgwDJN0Ns7AAWUadN+CUvDuE0nTmnKXRRHiCBWGnCRnz4yi9H0JgAD45REwUiFICAvLEJswAADU4vFdkeUx8imUwiC8nzyHdABNDDnyYiy4GICB+CimLfPcrdQMsohIn8YYILCYUHBceDKgyMSt3AyDGGFLw7IAEliFkxXqWBUF3ap0DoEjlPw955M88hGqk9SWtQdN+toQa8Ky8bcuPWgTF0dgVHG9RNB0GxbDSLdLJUVg+pmtBUBavIUgulrRBkHQKiUD4lDAD4aSAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_g_association.Rd b/man/tm_g_association.Rd index ef47169a7..9ffd8ac9d 100644 --- a/man/tm_g_association.Rd +++ b/man/tm_g_association.Rd @@ -71,8 +71,6 @@ For more examples, please see the vignette "Using association plot" via \code{vignette("using-association-plot", package = "teal.modules.general")}. } \examples{ -library(teal.widgets) - # general data example data <- teal_data() data <- within(data, { @@ -105,9 +103,6 @@ app <- init( multiple = TRUE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Association Module") ) ) ) @@ -153,9 +148,6 @@ app <- init( multiple = TRUE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Association Module") ) ) ) @@ -165,3 +157,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQlQDCAPIATHG6-QMVpuqkHaLD0PCi7ABitNTkjOy0og4upVpokRyjpZsYJpMdpe0StATc7ACMADJyL129g8BnGtMAusPU+2ohw+XymjFEP1KUHEBHyLEmMi6AF8uik5mJihlbFkCOwFGBRviukp9sMVHk8d1-BldABealBXDjPhCEQzeks4QY8aVUgwRISRLQ0REAi0QJWCCUyoyqpwEx0hlQRJhUjMDSJUSoOC4nmypXoxX4wl4PWy0RwEQaRUWq2kTXa3VU-UygH0S1GsAAZUtOtIuj2jHF9BEiHxTOdLt0sKINzEisDwZEiRjcYWKWAwGNg3xP0h0bxYAACgCyOHdPi7KxteXK9VAvAy2AXhGozLbX64PxPSWoE3W23TLRQl3FYsAIKPL2uSOyt76uQD2WB9lKlWhNWTB066VRtGwPT07NjU2z9u+630jsarU7s36t0eo-ei-+xNQENiMOnwfR-Kxgh43pd9PxTf800xIJM2PXN811YtS1IWswCrGs8ArFD6z5CgkObRd73NV9R2fOwsMbXClyjGBhE0SJD3sJxnEol0TGHYjdAnKcZzbec5z1ecui6WgFQ2VR1U0HQbFscoqVEQoIFYcd0HYfYABJ6ihdBVItRgdE6JQkSUMAkR+IA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWT64bGlAF9+zOh4UQrc23yFMCnRjaUAKyIVNIBrOFZlzLXjfjgTKGFSNIJ+WlECNP3Dk7PgBdgxFfCcgAum5oOgJipiuxaiFcroALyw8K4GF8IQiUQI3Ro4T-GF1UgwNISNJQUSiIgEWhhKwQaEDOqMhomLGZNLRUjMDRpUSoOAEemMoVIqCLPSIjZbDYohnC3SiOAiDRYhVKh68-mCuWM6hQeiKrEbAKK-mkXRaFjU+giRDS-HagglA4EMRYi2MK0iR5O2gu5b27Ui4DASUjbZgIFAmWBoUCo3OAAa0t0Gywgy8rjwKbAXgA8o4AHIOACayclWAAsmWwAEHIM7IMAIzV2tphsAJmrfjsdgAYuGqhsAEIVrAAaSwnbA-Rjujk0ZjqtNcH4hrAaYzdtl2pMtCiK6xvcGowCrm3QpnwvnAfNLExiLZHK56r5cfPjN+8DXUrwN7qS+VREAJfTU-x1PUDQlGsTWVd1PTEW1f3fWMfT9N1LT1L1HWdPFkOFTJg1DaYIyjMDY2hGtE2rDdM0HHN8yLLBSyzcsqxYms6wbZt2NbetBinOjuz7AdsxHcdJw2S9A2vPD-xg8hVygsSJwEsjsXuWg4nFewnGcBdA13fdFN0I8TzPaSbykucYX6fpaBZdgVHIZ9tDgGxbBqBlRDKCBWEGdB2DQVAABIWiqILgoVRgdD6WYlDAGYgSAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_g_bivariate.Rd b/man/tm_g_bivariate.Rd index fc0675ee3..070d9f8b1 100644 --- a/man/tm_g_bivariate.Rd +++ b/man/tm_g_bivariate.Rd @@ -116,8 +116,6 @@ For more examples, please see the vignette "Using bivariate plot" via \code{vignette("using-bivariate-plot", package = "teal.modules.general")}. } \examples{ -library(teal.widgets) - # general data example data <- teal_data() data <- within(data, { @@ -165,9 +163,6 @@ app <- init( selected = "Treatment", fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Bivariate Module") ) ) ) @@ -175,7 +170,6 @@ if (interactive()) { shinyApp(app$ui, app$server) } - # CDISC data example data <- teal_data() data <- within(data, { @@ -224,9 +218,6 @@ app <- init( selected = "COUNTRY", fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Bivariate Module") ) ) ) @@ -235,3 +226,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQlQDCAPIATHH+GRgmzPDs-QNdAL5dKdDwosUZtlkE7Apg09tdSmiowyp5W90jsQC8F1C4Fbp8QiKiutekMIkSifTaLLSBcDOlUqoVeN0SYVIzA0iVEqDgm3uwJuSz0122uzwSOBojgIg0YNx+NIsPhiPOyMq1Cg9DxYO2AGU8QjSLotH8aSJENs7hTKQR8kRaAQxGD2Yx-vQRIkBUKRSsUsBgBjBtsALpquS8yk45kaOD8emEEgEHnY5EmWihA1ggBiAEEADIM1x8ypdZFa7GsMEpCGhKHqElwhFAymLWBo3QqgZmt26Ikswl64NksM66m0vzosBM4lsjlSuDcrHxyqy4Wi67iyXSivy1ZBJUx9Wa7U6hMpm05wSoIIAazgcY7D2EmkiUYdzuc7Z1luthuuU5d5t0HuBXr5jCI2USJnUcFZ1z9kOhqdDq4j8CNmNnuvz10TMJD5JHmbpObzSZrnOLw479ZVgWEq-jKgqVgqGTNjsqpgBqm4jk+5CLtGYB2Kw8L-nOVrdroy6ujq67unebR7geR7gqeQakhe8ZXlGLaljqSHJsSNGvh277ZqhX4Ej+RYlneyKAS81aFnW4ENoqyowbGcFtqulRIbh2x2NUgTwGQWGUvOuH4auRFrvcXRdLQJi6OwKjkGe2iAnItjlOcoiFBArD2ug7CHAAJPUpTebijA6J0SizEoYCzGqQA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWT64bGlAF9+zOh4UQrc23yCdgUwKdGt-oArIhU0gGs4VmXMteN+OBMoYVI0gn5aUQI0w+Ozi+AF2DEK3CcgAum5oOgJipipsBiFcroALzw8K4Wq6PhCESiJG6UgwNISNL0bQsWhhOCwup1KK4zJpaKkZgaNKiVBwDbo6koqCLPTIrY7LZouHc0RwEQaXHiyVPNkcqnc6nUKD0CW4rYBCUc0i6LRk1UiRDCrlKgglI4EMS4-WMcn0ETPC20K2XXLAYCCka7MAgkFyEVK6kynVwfga7YAcVceFN3JMtCiYdxADFBqMAq5RdT+tyA6bWHTcgyokz1HL2Zzs3V-vAI0LY9XdCGpciWxWFXHlar1QKwFrZXqDQ64MbG0G6ubLdbkbb7Y6py7AZkPV7pr7-YGJ+3k33MwANE1NuowR60OL83RpjPOLdBhNJ8PI6+Zru5nN3+pEAppe5W3XIvSjLMh2VZBrWl5rj6n51O20raiy8pgROKpqtQEYDjqQ52oao5HhOuiLq6NrDguzqukCUCrts3pbH6+bHs2CHkE+uiClgACy+ETg+u5Xumr5Nu+dQMdy3S-uocAATyJZlohlaKtyEH1rR45KnBbbMayCldnUqG9mx-bMdh854WpQZETOJm4U605uuE1ENvRMHBsxfFbF4ADyjgAHIOAAmtx96JnxL5ZkGwm6O+-T9LQJi6OwKjkCB2iUnItg1HCohlBArCDOg7BoKgAAkLRVEVxXiowOh9LMShgDMIJAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index 033161a0c..1b67c42c2 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -74,8 +74,7 @@ It offers several tools, such as histograms, Q-Q plots, and various statistical visually and statistically analyze the variable's distribution. } \examples{ -library(teal.widgets) - +\dontshow{if (require("ggpmisc", quietly = TRUE) && require("ggpp", quietly = TRUE) && require("goftest", quietly = TRUE) && require("MASS", quietly = TRUE) && require("broom", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # general data example data <- teal_data() data <- within(data, { @@ -90,9 +89,6 @@ app <- init( dist_var = data_extract_spec( dataname = "iris", select = select_spec(variable_choices("iris"), "Petal.Length") - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Distribution Module") ) ) ) @@ -100,7 +96,8 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +\dontshow{if (require("ggpmisc", quietly = TRUE) && require("ggpp", quietly = TRUE) && require("goftest", quietly = TRUE) && require("MASS", quietly = TRUE) && require("broom", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # CDISC data example data <- teal_data() data <- within(data, { @@ -140,9 +137,6 @@ app <- init( vars = vars1, multiple = TRUE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Distribution Module") ) ) ) @@ -150,5 +144,20 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +} +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBISqDC0ogT+uLpetHCk1Ky6ALz2Ts62AGTpuu7Rvv6B6BFR3rHxSSkuGVk53nkBRCbkoqRF0aUJyQ6VupnZnrVwfmAAsgCCAMrjrSVxHRVpPdX9PoP+TEREMNMxs+VdaUoAxLpSEGrUuvxQpFC6cAAesKgiSlc3BsZc1AD6b1A2r2utyMugA7rRSAALFTsP6REBKXS6HyhD7IxihJQAX0UED+0HgolhQNsIP8KNE-iUSjQqDRKghfggSL+5ThiN0fCEIlE5TozSZSKRpBg3wkv1CpAx9EEmmsHKFl0l3y0LDZQO+Dyl6lI31EqDgBEFiqF+NgemS5IxlLwCpNojgIg05QdTt1+sN7FVGKg9BE3wIkKItAIYiGFP8cki-gACrFuBgADIUCRQyN2pG4xVZ3S43G0Ey6dgqcjMSw6Gy2BHM3SiaEQVijdDsWkAEm8kTbDsYOkYuKxSjAWIAukA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBISqDC0ogT+uLpetHCk1Ky6ALz2Ts62AGTpuu7Rvv6B6BFR3rHxSSkuGVk53nkBRCbkoqRF0aUJyQ6VupnZnrVwfmAAsgCCAMrjrSVxHRVpPdX9PoP+TEREMNMxs+VdaUoAxLoAwgAiAJLjJ7r8UKRQunAAHrCoIkp3DwbGXNQA+l8oDZPvdHkZdAB3WikAAWKnYQMiICUul0ozO4wAMj9shjsUoAL6KCBA6DwUSIsG2CEEIb4rH+EkAKyIKn+AGs4KxKUCacZ+HATFBhKR-gR+KECP9WeyuTzgGTYGIqQ85ABdJRKLQsUQARlxBFhbIIYn+ojgIg0cH4fggaJ1jFoUHoInFxtopt5YOAwH8DP86vVkTp-qwwyK-hOAHlHAA5BwATUjYHGzgAGky5LhUboLVbyPxynHHFjGRASUo0KhcSoYXa0UDykjc3whCJROU28IVbm0aQYP8JIDQqQnfRBJprH20bdR-9Hc2wf8XmP1GLRKg4KH7bO90r4OV-ZjGXgZ3v89vSOVLxpzVud3un7ojSaxOVHc7XXB3W-vQ9fWPAkwCDEN6QAcVcPBdH8AAhYYsAAaSwPUsxzXdnzRW9CyPMB4KQlCInPJ8YFFWh3j0ZIADFRixNN0Mw2cTFoZ4bXKGi6NcDCnxJZ9s2I5pmAeBcWCXYTV2YO9N23BtMIPSiYLAAMz24vdmOochGHKdTNPvGTiL3R1O2SIy9QYxjdFIjTyJEPZUgM3ReJ48y9wkRgiEEVARK05IgRXZ41ykh9ZOfeTcOUlynx0mRtNoDSZD0x8LKMj9dTMhy0SszQKLslwHKcvcCsc3MSRJWgTF0dgVE09dtEGORbBRXdRHhCBWFGdB2GrAASbxIh6i1GB0RgSUJJQwEJdUgA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } } +} + diff --git a/man/tm_g_response.Rd b/man/tm_g_response.Rd index 6e9e1e93c..0f9ae470c 100644 --- a/man/tm_g_response.Rd +++ b/man/tm_g_response.Rd @@ -98,8 +98,6 @@ For more examples, please see the vignette "Using response plot" via } \examples{ # general data example -library(teal.widgets) - data <- teal_data() data <- within(data, { require(nestcolor) @@ -134,9 +132,6 @@ app <- init( multiple = FALSE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Response Module") ) ) ) @@ -146,8 +141,6 @@ if (interactive()) { } # CDISC data example -library(teal.widgets) - data <- teal_data() data <- within(data, { require(nestcolor) @@ -180,9 +173,6 @@ app <- init( multiple = FALSE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Response Module") ) ) ) @@ -192,3 +182,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6uoxwAI6CtNXsPqKkxNREjIoQlTCtLKJxur0E-RWmHbrsWroqugTsCoSs1Iuli1qiq7qLsFuLUiyLcrbl3ZVDfYyiwMBaALp3g1DiJuqkHezD-Tf3d12VAF8lACuiloPBRMUMrYsosvldFm5oOhBio8gszildABefwZXBjPhCEQDXFE4RiDHnXSkGCJCSJaqiVAkURwKnU3TUKD0OB+XGLLBiFkQNm6AAK7VImzwY2pTJFYtxKUSYVIzA0iWZcHmcs5YNgegFYHhMoJZ05ujZIg0OKtfJ1pC1qB1HMtlW5vP52zAAGUHbatCxaDyRIhVnrLQR8kRaAQxHag4wQ-QRIlo7H45CUjc4ZcZQ9Srqlis8D6DowjnJze7ztbHXB+HbFgRlhGLe6YMJNJEjboAGIAQQAMr7nDXa6ZaKFG3ah6PXB3qf9OdXI7pQnaVWqNU7tbql+cDfBmyb8+3a-Xbbir3uXQfJ1yeXzT-6baRdEmU2GL5OM3GE1xL9QzgdMYwA7MMlzM8RgRMBCzmBYwA2PYUBgKsJ0vANyCbY0UNlQ9qS7agexEOcRzHTD3RMadZ1xecx3XSoV2XPUVy6LpaBMSYVHIXdtHZY4yjGURCggVhB3Qdg0FQAASepShk2S2UYHROmBJQwABO4gA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXUY4AEdBWgb2CDFSYmoiRkUIOoBBHwCAGWT64bGlAF9+zOh4UQrc23yCdgUwKdGt-oArIhU0gGs4VmXMteN+OBMoYVI0gn5aUQI0w+Ozi+AF2DEK3CcgAum5oOgJipipsBiFcroALzw8K4Wq6PhCESiJEYgTCQHouqkGBpCRpBqiVAkURwWF1Bm6ahQehwai4rZYMTUiC03QABR6pFEWzRcMZlJ5fORmTS0VIzA0aSpcA2RMZKKgiz0yK2O1F6sZtJEGlxxtVTxVavFGrqzNZ7N1YACbItui0LFoLJEiANNttBBKRwIYlxHsYXvoImeQdoIcuuWAwD1I12YBBIKqarAACEALJYADSWAATKLdFsvAB5RwAOQcAE09nIxbaja6NHB+BzcwXi2W8IaNTBHrQ4jrdAAxQajALOVttuomWhRLu46ez1z+hn9W0todRXGy+WKy2oVX0tv-eA9-WD7d1c2m5FPs8XoeM+1snsuk2kd2et6cC+vei51IGwahsi4aRtGEFxoCmRJim0zppmujZnOAAa5acoMXiuGAcj7g+DKvmuTpYPhhELouI7UJo47rjOc60W2y6rt2yIbnOH66LuGoCXUAn9P0tAmLo7AqOQp7aHSxHVOiohlBArCDOg7BoKgAAkLRVFp2m0owOh9LMShgDMIJAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_g_scatterplot.Rd b/man/tm_g_scatterplot.Rd index 466294031..c8b39bbe1 100644 --- a/man/tm_g_scatterplot.Rd +++ b/man/tm_g_scatterplot.Rd @@ -108,8 +108,7 @@ For more examples, please see the vignette "Using scatterplot" via \code{vignette("using-scatterplot", package = "teal.modules.general")}. } \examples{ -library(teal.widgets) - +\dontshow{if (require("ggpmisc", quietly = TRUE) && require("ggExtra", quietly = TRUE) && require("colourpicker", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # general data example data <- teal_data() data <- within(data, { @@ -185,9 +184,6 @@ app <- init( multiple = FALSE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Scatterplot Module") ) ) ) @@ -195,7 +191,8 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +\dontshow{if (require("ggpmisc", quietly = TRUE) && require("ggExtra", quietly = TRUE) && require("colourpicker", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # CDISC data example data <- teal_data() data <- within(data, { @@ -272,9 +269,6 @@ app <- init( multiple = FALSE, fixed = FALSE ) - ), - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Scatterplot Module") ) ) ) @@ -282,5 +276,20 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +} +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBISqDC0ogT+uLpetHCk1Ky6ALz2Ts62AGTpuu7Rvv6BzgAepMwRUd6x8UkpLhlZOd55hETURIKMqLQEANYyZdGVCckOtUoAxLpSEGrUuvxQpFC6cIWwqCJK84sGxlzUAPpbUDabC0tGugDutKQAFirsR5EgSrrZno1w7NOipMStjEUEDeAGEAPIAJh2unBEKUAF8gUdoPBRI8zrYLv5Yf4lEo0KhoSobn5gXMztUnq9dHwhCJRNVacIxKS3m9SDB9hJ9mEFuQOq1SKy2W9qFB6HBZsl-ABlAh8mTrIikGG3IhdMQRakiwqUs77FYldSkHmoOAEYUit7I2B6aVgHF4bVW0SS80q5KukQaU3my1W0XiyXVWVujS6LQsWjikSILVkgNvAhqjUM5KRxjR+gifbJ9UEFlHYDAbGQ-wAXXLkQt-mIFjK-kEqEWvX8cjkuGdAa97rg-BDzXrToTiZgwk06ztugAYgBBAAyMucnZHAZMtEKfeqc8XrlXbKBAY7Xd0Q3JiwNxWYPtEZpr++tZxRU9LcOHid0PfDnrDJtvfpPEUxQlKVdFDb0VQzLNY3jD8kxTAs0wjKMYzgXMEMLM5i1fCsq10GtB3CPAwLAJsWzgNtjwfNkv3Ift7TIqBW3fOCx2oCcRG3BclxXODTA3Ldkh3JdAN0Q8rSogN-iIRh9noM8jkvI0bzvf0RRteAB0dXjE1o6paN9e8+OA4N7RlX9kMzVC4xYj881TaooNQ9D8xZUT1KwksHTLMBKx0viCIABTFMgGzAOxWDNMK7HcBZ4FC4jaxIIjIkbZsmIosBxI-SS4NowTdAAOUced5380dx1oScuN3cq1wE+iZ24vccpPXKRVEWgAC80PkvUL0Na8-1U0SNJfby3zqmiLJ-CDDLUq0TNA8D3Us6C4BsqaRXsxDHJQ7M0J2zDFmwibcOrPxCLCxjmPbLbpoggq0vI2DWMq6qhOa+63nXTdGuElrE2yg8psYIhLn2Ex1FifqoCUob5tGp9bS0nz7r02b3UR6jAxAgdzIgtbrNeuyMKQpyDpc1N0ROrzHT8-DLuCqAEtS8LIsytmYrgOKKFISjvs-X8CuK0rBbYjipwBwXfoKgHROBt52rZf5Iehj1zzhwbjWxj8xtRybRIxoW5v-Iy4KW-GLIpmDbMTI7yf2nMHZpqBTvpvCgpC-nEvZqLfe53mEru9yTd7RrRbK0OJaqzjPtq0PZf+5qFba51xKBIFaBMXR2BUfljW0L5210F4yVEe4IFYWd0HYAkABJvEiBvXUYHRAQRJQwHhcsgA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBISqDC0ogT+uLpetHCk1Ky6ALz2Ts62AGTpuu7Rvv6BzgAepMwRUd6x8UkpLhlZOd55hETURIKMqLQEANYyZdGVCckOtUoAxLoAwgAiAJIAypO6-FCkULpwhbCoIkorawbGXNQA+vtQNnur60a6AO60pAAWKuznkSBKutmejXDsEDEpGIrUYigg3wAgtN5gAZQ7ZaFwpQAX3B52g8FEb2utluBD8YCRsP84IAVkQVCdeqxsec8cZ+HATFBhKQTgR+KECCcKVSaaJgBjYGIcWs5ABdJRKNCoBEqR5+CHLa7Vd5fXR8IQiUTVLXCUUa76kGAnCQnMKrcgdVqkJXfB26ahQehwajVfzzAhWmQ7IikKZPSkEMQRI0Owpq64nTYldTs0SoOAE8OO4XwD1EmEkvCph2iN3JgPJAsiDQWpMp5WOx3O13u5KewsaXRaFi0F0iRBh6s174EINdMTVNuMDv0EQcwchunXYDAfzE-wSiWRFNEgDirjwun8ACEALJYADSWAAjGV90fTwAmUlyXB5x2lotwfiZyFbnt9x0wNm0HY9GSAAxSFYXmZxH17PsTFoQo32qUDwNcaCHXBPsHzzIYVTWGNimYctE2Te0f3TIDdyzZFc1Q74XxbEtmwTSsSJ-J0XTdTN5kY1t207OBu2o1j+2nYdklHcdJwHYNRXOedF2zZdV10ddP23SIrxPc9LzAQ9NLvMA5Ewmj80YhDGx068tMEoS-2oTRAMQsCIKgoTTDgszdCQiCn10dCayMvsQSIRgTnobDzjwuNCOYnyyI-BTrL7Oji10ZKK2InzvjrDjzK4ssA3EviBJcoSpKHXUxN4ic4CnaTsUyh1ZIXSicxXErXJUr8dw008L26iy9O0rBIUmNSKKwZwN1mAB5AA5Pq-NYgKhOSjzZscWFYXan9bPskRHOQ7aYPc98QKclClrzZbn1oAAvGqwqjXDYwIpiMuMuLzKXRKa2S6o0qIqtXOyhsKLyoseLHIrv1KkSKshiSarKmcxSgOSWsUtdCVU7TdN6+8jt+0zToonGfr7XaAP2s7Doa2D4JJryLp-Ra0MJxgiDuE4WRDFKIpe+N0qB0jrkxcj5KownaO4hj8qFlifxBzjuMK6rioa5HRIRvjavK1H0e+trlMJPGsH09SwGG0ahsmmb5oJhrVpJ9bNqlh1KYcmnnLpk6Du84zWe+a6HRBbn1FiJ6oEi175di0WRXiyWfL+2Wi1j4ysvY0Gm3y7W1Zh1jNfh1XJLh-XmsNpT11N83xpGsb-Amqa5oW4OkuJ6oXa2hqPepzzzrd756Y8pmfMD3zwz88FwVoExdHYFRrXjbR-kM3RPmVUQXggVhIXQdhZQAEm8SIj4LRgdDBVElDAFEJSAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } } +} + diff --git a/man/tm_g_scatterplotmatrix.Rd b/man/tm_g_scatterplotmatrix.Rd index 65672cb11..294eae5ab 100644 --- a/man/tm_g_scatterplotmatrix.Rd +++ b/man/tm_g_scatterplotmatrix.Rd @@ -48,6 +48,7 @@ For more examples, please see the vignette "Using scatterplot matrix" via \code{vignette("using-scatterplot-matrix", package = "teal.modules.general")}. } \examples{ +\dontshow{if (require("lattice", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # general data example data <- teal_data() data <- within(data, { @@ -130,7 +131,8 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +\dontshow{if (require("lattice", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # CDISC data example data <- teal_data() data <- within(data, { @@ -182,5 +184,20 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +} +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CmlCkmgRw-ri6XrRwpNSsugC89k7OihAAxLpSEGrUuvyBULpwAB6wqCJK+aSFRrpc1AD6VVA2lQUGxgDutKQAFirszeEgSrq6xOakjFGiHXkFGCbM8H4QY2O0-AnjfmAAIq54uv4AYlhhx2AAknYX-s4AyndgAAq3R-4A4ucfYAByABlngAhQ7hfwAxzPACC7zkuFG6wkRB0jAg8DI2xM6lIREYq3W6wI7AATOEyboKQBGcm03Q0+nhBkk+GIwnUKD0ODUWaJYn+ACyJBYBF6rGeWDgqEE9DoBH8qUJrLW6w5EAkgigUga2JgtFiWJxeIJhJ2DIAzOFLbprdbqUyrUzlabdByuTztvywJ8ZDAoMp5b8ABLckQBiVEP0WUJgRXrZ3rVBEaUczQkT3sAAc1oAbAB2cI5gAM4QALAX6SX6QyqRWqQyixgc+EAJwJsYsOCFPnsc0AVgrfb7FqLDL7Rb7rep5oppZH5Kb4Wz7cy-FQGfNGFLC4rJIwNa34Ub1sbFMbFcbk90jYbW5X-Dg9FIGb3zIwdsPlMXX4-25-C7-PdfzjONRG4MQ5maRZljgE0Ni2RIqUQccERVMYJjINgGk2bYwJgcpYLZIldgOZ4zmeG5nkeZ43meb5nkBEEwUuSEYThVCXVEWgAC89ESFCiLGdxynUPikhcIiV1YLtGFwvFSHYPCCNJUci0QEkiw08IUN0YSORCbYHBcOQVx0CBBDEpSRHYL1RD9ahqGeeB+FoQQYGeDlGCkZ4SDobIFW0qs9NEwzkhXAh-RCBy4AQ3QrNg4kjOccITmhAEHhSQLwmCgzEiSlcvH9TRSDiRI0TxGB2B0qkiyrDTwqIURSF5XSIAqqqq0zOqixXVBGCIEwem2crGEqnStMrEClAAX1SZpoHgURBgKWxai9DCphmZ4wJEUQFSUAArIgVAaABrOBWCW5pVuMI6TvOy6TTuiAzou3YNumMRng+rbfk2ALEWe16OH8Havt+MG9r+-gAZVIGHveohJk+qHwTASGLi9f6wG2fwPtYbCYdjVJUiUNB11qFQehNZptiGRE+CEXbtkZ4QxDguoYAaCQGlECKghkcoiFIP1NuKDmxjdblcbAB5+fIRghefUXpmKMJBN0LQWFoTlmcSOgmol9ZmgaEophxXnUDgfk0JdeZqgWsS8aRzDfo4u2xlEblrefRIvZEDRLeto2XSl3JEn8B5vY0TXtd1sREHV22PdFY6QharXpnjhpU9odPluqYBgGd5HfoAXTLlcPf9n2YozfxOygZ4JDXZ4HyfWGPcJGBhE0AjQpcd2u90PEH3cWKkqHrvBuKOvElS9LXGT004xdKvjYKU3inNwPRCtm3h-m2AnfR8DUY1wlBuoBWsX1BWg4P4fXU5aWI9l6Pn0znXZTgRO8Av00mcWol0wgTbGU8U69DThBRIWtqAWRzlAvO7NmhF1BmffwFc0b40Jp3J+NcNBzx2P4UivxyK-Eor8aivxaK-Hor8RivxQTPFYr8WEeDh492vrQfueVkgALGOvQkBDfZxQ-g-EOpow4yyjgHT+ccf6iD-hAu2ud07bC-tnNRKCChoNPrtTBZdwhekKmQHo4pfjECaqjS4fUBo9AVEI00IiiEmM1GYkq31GrNWeHYwapAOFdy4X3EQA9koCPWKPGQRDJ4RLGDPIhC8MoRNXivDWqSpoQFSLQEwuh2AqAVjibQsETK6BGCqUQ-QICsGhOgdg5MAAk3hwiNK9owVEqRppKDANNMuQA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CmlCkmgRw-ri6XrRwpNSsugC89k7OihAAxLoAwgAiAJIAypm6-IFQunAAHrCoIkolpGVGulzUAPr1UDZ1pQbGAO60pAAWKuwd4SBKuroAgtn5ADK9uoxzi1Oz2Vj5y6tb+UoAvqkd0PCiY6W2TQR+YGsLYbr+c9v+qQBWRCqtANZwrAuHWuxn4cBMUGEpFaBH4tFEBFaXx+-0BwFOsDElwacgAukolGhUMsVIM-BBph0EsVSrgNnwhCJRNSGcIsRtpqQYK0JK0EYFyIwakQuYFGLQKuTptLdNQoPQ4NRqf58gQBTJhaRdDAxRKwhzpVoWLR5UzqXRRKQpTLpR1WpVSMwNHzUHBbgabTSGmc9IkXvNHngPTbRIq3VrEqGRM7RK73RTPTa5QqlX6wPkwxpdEbxaaxIh9QnE9KCENviFmYkcyb6CIYWXaBXsVBgMB-eswLjcXI6UXi7oo+G4Pxqe77gBxVx4Z5gLAzTJT8Iq5wADXevf70pgUNoNV9SRcG83uiIjDB7hHiQch+DnpMEuH1IAYjMFvlXH3Paliz3b16oPaFSOuo0Kxm61rFhi8DKvc+yFpu97UIK1KIYKLrgX+MrJoqMEZtGWoUPwqDfGQogFkGn6Jjmla6GOAAKMxzgAsjkTwvAAagUuR2OumElg2FbUka1CCHA9blliHStv6bydri4T0YxMwsdkbH3Jx+TceutF3AxzFqTMGlaWAci-pRnqDhoj5prkABy7HOHYujGM4tnZLoADyT66HZ2SOJkdi5B5tnwce25IbuIjUteH6bmZm6WRGA6ZqBcYQf22GpjOeHhtmxp5mRoWbqWEk0dWebiY2kmlNJsGyV28XHol1k6S8k4Gexr4GdkACavHmTa4WaHu0XJEem6nueLUxeN-b3hULUvm+sX9t+iZrTKG26GtqSpLQJi6OwKiCiB2hwDYtiTAmogjBArAzOg7BEgAJN44QvaGjA6IwqSHEoYCHLiQA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } } +} + diff --git a/man/tm_missing_data.Rd b/man/tm_missing_data.Rd index 878adeb14..505a3747a 100644 --- a/man/tm_missing_data.Rd +++ b/man/tm_missing_data.Rd @@ -58,18 +58,7 @@ It is useful for clinical data analysis within the context of \code{CDISC} stand adaptable for general data analysis purposes. } \examples{ -library(teal.widgets) - -# module specification used in apps below -tm_missing_data_module <- tm_missing_data( - ggplot2_args = list( - "Combinations Hist" = ggplot2_args( - labs = list(subtitle = "Plot produced by Missing Data Module", caption = NULL) - ), - "Combinations Main" = ggplot2_args(labs = list(title = NULL)) - ) -) - +\dontshow{if (require("gridExtra", quietly = TRUE) && require("rlang", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # general example data data <- teal_data() data <- within(data, { @@ -92,12 +81,15 @@ datanames(data) <- c("iris", "mtcars") app <- init( data = data, - modules = modules(tm_missing_data_module) + modules = modules( + tm_missing_data() + ) ) if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +\dontshow{if (require("gridExtra", quietly = TRUE) && require("rlang", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # CDISC example data data <- teal_data() data <- within(data, { @@ -110,10 +102,27 @@ join_keys(data) <- default_cdisc_join_keys[datanames(data)] app <- init( data = data, - modules = modules(tm_missing_data_module) + modules = modules( + tm_missing_data() + ) ) if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +} +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEulIQatS6cKGwqCK6-FCkUEr9gwbGXNQA+iNQNsMDUGO6AO60pAAWKuwz0SBKurme3r6toqTE1ESM9fu6UPz8k9CiS2YWmtahtnsQBwehwFE3RE7FEnkm3BIEnYX2iJkuV3YIlKGxhtgAVLlzLQTOwAIzRDAABgArIS8QB2OTUgC6SwAcgBBW7-W4AXyUtx8tBeRl03NEtxg5xYvOMwoIos5v35QVEwDpfOK6ES7AF0Xuj2e9QOEtFCqWyp6HD1jFEGoeTygoh1ulN8uA-gIrGo-hpiuM1owJnUpER9uAjsILrdNNtAaDUhYoaWXp9Gn9IrNgf8UcYofqbPqM2g8FE2wWtj5BD8YAF5X89v8N2g6CWKjWfhlMxqOyFAmEYhqfCEInzLN0pBgkxgPNEKgk0wWcxl9XqON0atUzEsOhs31uok2EFYjPQ7DQqAAJN4Negj2DGDprkoORAwGyaUA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsBKMtPzOAB6kzP64ul60cKTUrLoAvPZOzrYAZJm67rG+-ozUUBASUTHe8YkpaS6KEADEugDCACIAkgDKzbpwobCoIrr8UKRQSiNjBsZc1AD6k1A2E6NQ07oA7rSkABYq7IvRIEq6uZ7evhBipMTURIz1pwCCrZ0AMuuML+8nui9YnU+-06SgAvvVFtB4KIDqtbEZdAQ-GBvm9yv5gf56gArIgqOYAazgrBhi3hxn4cBMUGEpDmBH4tFEBDmuPxRJJwEhsDEsLGcgAukolGhUOsVNs-BBTosaodfnwhCJRDVFcJeb9TqQYHMYEzRCoJAtVstpbp6vVaCZdOwVORmJYdDZbMczaI9hBWE90OxRQASbzRf2iGQ6B5gpRgUECoA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} } + diff --git a/man/tm_outliers.Rd b/man/tm_outliers.Rd index 4ca23deeb..3d76bf5b7 100644 --- a/man/tm_outliers.Rd +++ b/man/tm_outliers.Rd @@ -58,8 +58,6 @@ such as IQR, Z-score, and Percentiles, and offers visualizations including box plots, density plots, and cumulative distribution plots to help interpret the outliers. } \examples{ -library(teal.widgets) - # general data example data <- teal_data() data <- within(data, { @@ -97,11 +95,6 @@ app <- init( multiple = TRUE ) ) - ), - ggplot2_args = list( - ggplot2_args( - labs = list(subtitle = "Plot generated by Outliers Module") - ) ) ) ) @@ -147,11 +140,6 @@ app <- init( multiple = TRUE ) ) - ), - ggplot2_args = list( - ggplot2_args( - labs = list(subtitle = "Plot generated by Outliers Module") - ) ) ) ) @@ -161,3 +149,18 @@ if (interactive()) { } } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXVIhrqu-lCkULpwAB6wqCJKAUEGxlzUAPoxUDbRgcFGugDutKQAFirsKbi6IEq6ugDCAPIATHHV9RVNdcDACmCojLQwLKyJANZwrJ0AumONonAAjokiEOwQjETZ7LV1cooQAL7bKdDwosUZtlmdG51KAFZEKkMjxylnxrf3w6zHbxAPHBfNeF0-zqnVKnW6vX6v06WzcEC0LFEjQI+TuBDEiWmIg0cH47ARPSg9BEiRRaLEJyC7WB4zGpQI7E6AAVqFAyKCgWA7KxUHAOZ07Iw4IF4OywFttko0KhGio8oyIJUUroALz+DK4Fp8IQiJFq7XCCktSqkGCJIiCUh0GTHY2VXQWq20GSJAmq3R0USkBX233qoKJMKkZgaTG8hl2v3+tmwPRqml4SN+rFwDTulOh0Thn1Rv2s+hwPzxsAAZULqdIugJtCJIkQoKTUbJtHReqrLBrxLgpNRLYpKWpYEuYAm9MZhBIBH5YEEqCCwxhck1itzvoz5H47s6s-nfMTK9XlRgwk0kTjugAYgBBAAyJecy8P9pMtFCuPd17vrgPue2q7-fpLkmBCBHAEhED0IFJG6aqet6jbRoGoTBuopBhqmOargcsZbkOAKPoeL7UOQjDukRJHoRGP6rgSba0QRT7Nq27oItQgjdkx-YZIOw6ju2jCiAAJOuuJAdRuYiZuaqsexPbkk83EdHhIIjnS-FCZJYlPkeJ60Ge7oOC4CGVABUamfa5kAds2y0CYujsCoJGodocA2LY5QrqIhQQKwV7oOw0qCYItClIF0yMDojDbDsShgDsYxAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAokqUBiXQGEAIgEkAZS9dfihSKF04AA9YVBElUPCDYy5qAH1EqBsEsIijXQB3WlIACxV2TNxdECVdXQBBHwCAGWTdRkaWpQBfRQhM6HhRCtzbfIUwTuaJpQArIhU0gGs4VmHMseN+OBMoYVI0gn5aUQI0+cWVteAB2DER8LkAXTcIXY00rRZRNKh+UWobUG9wAYrRqORGOwTg4XFVRGg4hxMsBgBMphMnk8qicMO9SERGHJiUovoxRG0CCUFgQxGlRHARBo4Px2GTaFB6CJDtTaLT1rlUeimtMwFiqvjPt9fv95H0lIi2ipiuxaiFcroALzq8K4NV8IQiCnag3Ce5quqkGBpIiCUh0GTDC11XS2+20GRSxha3R0USkVUQF3BnVQNLRUjMD6iVBwAiBkMh27wH3Crp4Z2JhlM0g+7Nxg4xuMJxMh6icxmpsABRkF3TszkiRATPVB0vBqk0sQ+htcuA8rsC8JCyYizHY3Tx9EAcVceF0EwAQgBZLAAaSwAEYJsTW+3g-nmfwq-VZy3M6WYPtaHE9NqQfVmgFnHv93UTLQoiyfQ+n642+2fSARecivh2YRwBIhJ8twXo+n6AYXnUmThlEkbqIWsZTgBpbJneC6jumYGlh+EIyD6pGQvSWElm+ZLGvW3zEe2nZ8t22pfNQgj9qx-IPFAI4YmKE70QAJIe5D8KBSEhhJ34cdw3EDmxQ4CWihGiuKjHkuJtZHtJOHtleEI3iIPqwv+b5AaW1nBrZujWX0fS0CYujQqoUaaDoNi2DUbaiGUECsPU6DsIiomCLQVThQyjA6ESPRKGA3RPEAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_t_crosstable.Rd b/man/tm_t_crosstable.Rd index 54b96b06e..3cc5c5cb4 100644 --- a/man/tm_t_crosstable.Rd +++ b/man/tm_t_crosstable.Rd @@ -62,9 +62,8 @@ For more examples, please see the vignette "Using cross table" via \code{vignette("using-cross-table", package = "teal.modules.general")}. } \examples{ +\dontshow{if (require("rtables", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # general data example -library(teal.widgets) - data <- teal_data() data <- within(data, { mtcars <- mtcars @@ -101,9 +100,6 @@ app <- init( multiple = FALSE, fixed = FALSE ) - ), - basic_table_args = basic_table_args( - subtitles = "Table generated by Crosstable Module" ) ) ) @@ -111,10 +107,9 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +\dontshow{if (require("rtables", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # CDISC data example -library(teal.widgets) - data <- teal_data() data <- within(data, { ADSL <- rADSL @@ -153,9 +148,6 @@ app <- init( multiple = FALSE, fixed = FALSE ) - ), - basic_table_args = basic_table_args( - subtitles = "Table generated by Crosstable Module" ) ) ) @@ -163,5 +155,20 @@ app <- init( if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} } +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsIykUPQiov64ul60cKTUrLoAvPZOzooQAMS6UhBq1Lr8UEG6cAAesKgiSgVFRrpc1AD61VA2VYVQBsYA7rSkABYq7M0RIEq6ujCkBCyinRNTM2OmRIy67Fq6KroEfoSs1OG6-lpheEcoMIf+Uiz+crajEOPjk9OMosDAWgC633NQ4hM6lIK3Yrxmnx+3zS4wAvktwe9Pv5UIxaDAWKwGgBrOCsfy-OaiTwNEQQdgQRhELpghbve5KWFpZrQeCiIbtWy1fyI05KABWRBUOLx7OaXOMguFuNY7KlEBFHB5dNOEWVb1V51R6MxiruaSUaFQcxUvT8T3y7USlqCuARAmEYmtfCEoXNzzqMAapAaBCpolEQRCcHdHt01GCcDySX8AGF-bM7MFKnglh6Stbmg1SqRmBoGqJUHAdmmwyzYHoY2BeeFSx7iSINNaG8WfYXi6Gw88I-Qo9b-ABlKOt3RaFi0ZNwRC1i1d8YEPpCghOpJjtGT32L2jLsXtZHVlUE74REt7A5nY6a-ywK5gG6MfV22dzlsaOD8a2ngj7W-3u5PudnhgYRNAqStkhcADAN0FZ+Bkd9rQcSC6zDExaBKBCkgAMQAQQAGQHVxnw9GEwzkKCPXiJIsxzPM2yLEtiOect4H7A8NRnQDX1IZth3zdtGOg8NI2jc4h0bHi1wnYNp1TJiPQXJcV1HccN0U7cxA5IJ9xrMBfhPXZv3PNUwBOW8bwvO84FuMB7gol8+PID8qzMuShOA6hQJEa1cII5x7K7NCMOc3RfMIlDxlIkjS1ItI0loEw1hUcg6O0EN7l0R5xlEAYIFYHD0HYI0ABJvAiEriUYHRGDSeEIDAWFviAA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsIykUPQiov64ul60cKTUrLoAvPZOzooQAMS6AMIAIgCSAMpZuvxQQbpwAB6wqCJKpeVGulzUAPoNUDb1ZVAGxgDutKQAFirsHREgSrq6AII5BQAyfbqM80tKAL5pHdDwouM9tk3+64v+SgBWRCqtANZwrAcdx8b8cCZQwqStBPy0ogIrWutweT2Au1gYkOQTkAF0lEo0KgViohn4IDMOokSj1cNNdHwhKEcUThNCCTNSDBWj8CIwiKJREEQnAMTMObpqME4NQcf4sgymfZgnU8JSOZUcR1WlVSMwNK1RKg4AR2ZyOZD4PywGdwhLOaJearSDijSJFcrVeqNRzufReTqCsaNLotCxaKK4Ih9ZjbRyCMMbgQxDj3YxPazfkHaCHnj1gMBTgtzmA4XCIqJBPQjaakmYLJprC9dFM-f6ObR+FKmgBCd3oOIwqARFTDGRDUQRahECSx7jsACMcgiav8OTKcHCun8AAUAPIFPIADQ007ni5X1FI-jkaQrnPcpEEjAg7D20JewCrlTh+4P23x5f95pNcH4Oqy88cADkHABNX0D0Jb5aFqPQkgcFwn2AohGHedwP0glIYIPExaEqd8cQAMVmRYClcZ9OXvYjUM5eIkhlOUFR+K0xyIzUegvHU9XFBiZlfV0kk42iVXo4D7UdJJ-GdC1TXDSMRB9NjgMDYNQySCSvWjeT4yCRNkw2NMM10LMcxiHEC0sYsjlLA1-RvFYG1qDgJl0AEME+DQ4O7Xt+2oIc93M20jxPM8LzUqA5Gvas728jlH3CjiXXIJCZzAAjlyAg8YFA8CcLwgiyP9dDMLi3D8MIisSI5Er7zSNJaBMXR2BUcgaO0Nk9zMv1RFGCBWFmdB2GRAASbwIj6o1GB0Rg0k2JQwE2OEgA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } +} +} + diff --git a/man/tm_variable_browser.Rd b/man/tm_variable_browser.Rd index 00d3548b7..9c4c3f119 100644 --- a/man/tm_variable_browser.Rd +++ b/man/tm_variable_browser.Rd @@ -54,16 +54,7 @@ or continuous with a checkbox allowing users to switch how they are treated(if < then the default is discrete, otherwise it is continuous). } \examples{ -library(teal.widgets) - -# Module specification used in apps below -tm_variable_browser_module <- tm_variable_browser( - label = "Variable browser", - ggplot2_args = ggplot2_args( - labs = list(subtitle = "Plot generated by Variable Browser Module") - ) -) - +\dontshow{if (require("sparkline", quietly = TRUE) && require("htmlwidgets", quietly = TRUE) && require("jsonlite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # general data example data <- teal_data() data <- within(data, { @@ -77,13 +68,19 @@ datanames(data) <- c("iris", "mtcars", "women", "faithful", "CO2") app <- init( data = data, - modules = modules(tm_variable_browser_module) + modules = modules( + tm_variable_browser( + label = "Variable browser" + ) + ) ) if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +\dontshow{if (require("sparkline", quietly = TRUE) && require("htmlwidgets", quietly = TRUE) && require("jsonlite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # CDISC example data +library(sparkline) data <- teal_data() data <- within(data, { ADSL <- rADSL @@ -94,10 +91,29 @@ join_keys(data) <- default_cdisc_join_keys[datanames(data)] app <- init( data = data, - modules = modules(tm_variable_browser_module) + modules = modules( + tm_variable_browser( + label = "Variable browser" + ) + ) ) if (interactive()) { shinyApp(app$ui, app$server) } - +\dontshow{\}) # examplesIf} +} +\section{Examples in Shinylive}{ +\describe{ + \item{example-1}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsKKoLADWdBBw-ri6XrRwpNSsugC89k7OtgBkGbruMb7+ABakMNQA7rT8UqSikdHecQnJqS6Z2bne+WAAVqIkdOS1MQ2JKQ4tSgDEulLhsrr8UKRQunAAHrCoIkoLSwbGXNQA+jtQNtuLy0a65aQFKuwnUSBKuro+tKJ7b4wfL7owpAILE+VwBQMYNQgr1KRHgUKuMLhfxMUFotzM1C+KLRBQxfwAwgB5ABMXyJxKUAF9FBATtB4KIHhdbFcCH4wO8anhdP4wcDav5ERQBWBsejhCLyf4aUo0Kgvio0X4ofMLk1Hn8+EIRJ8UlrhGJla9XsVDloWLQoPQRIcmERSqIZEbja9qFa4JiUv4AGoWq0iXR2h0yfx-V408NKGm0Ey6dgqcjMSw6Gy2Z4q0R3CCsACC6HYcoAJN4okXHYwdIwaZSlGBKQBdIA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } + \item{example-2}{ + \href{https://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKcqajGIgEwCu1OAGcMAcwpxm1AJQAdCLTIyoBUrQBucAAQAeALS6AZoIgbaJdnN0AVLAFUAoksZwAjoNrv2CsKKoLADWdBBw-ri6XrRwpNSsugC89k7OtgBkGbruMb7+ABakMNQA7rT8UqSikdHecQnJqS6Z2bne+WAAVqIkdOS1MQ2JKQ4tSgDEugDCACIAkgDK07pwAB6wqCK6-FCkUEp0TCwcgSFhcIoQu-sGxlzUAPo3UDZKL3e65aQFKuwvURASl0ugAgrNFgAZT6McFQ4Fg2Z2OzOGHg5GuCAAXyuL2g8FE-z2UFsRl0BD8YDhkNq-nRKP8Vy6RBUj2CcFYhJepOM-DgJigwlIjwI-FoogIj2ZrPZnOAeNgYiJ+zkAF0lEo0KhPipaKQ-BAQR8UgCEXwhCJRE1zcIlQiQcVHloWLQoPQRI8mERSqIZAaQQHdNQ3XBqE1-AA1F1u7Zen0yfz23RXEFXK60Ey6dgqcjMSw6Gy2IGG3SiX4QVig9DsLUAEm8UTrvsYOkYVyxSjAWNVQA}{Open in Shinylive} + \if{html}{\out{}} + \if{html}{\out{}} + } } +} + diff --git a/staged_dependencies.yaml b/staged_dependencies.yaml index 16fdd83d9..d484dfe68 100644 --- a/staged_dependencies.yaml +++ b/staged_dependencies.yaml @@ -5,6 +5,9 @@ upstream_repos: insightsengineering/nestcolor: repo: insightsengineering/nestcolor host: https://github.com + insightsengineering/roxy.shinylive: + repo: insightsengineering/roxy.shinylive + host: https://github.com insightsengineering/teal.logger: repo: insightsengineering/teal.logger host: https://github.com diff --git a/vignettes/teal-modules-general.Rmd b/vignettes/teal-modules-general.Rmd index 4ccb9a329..6969a0695 100644 --- a/vignettes/teal-modules-general.Rmd +++ b/vignettes/teal-modules-general.Rmd @@ -10,16 +10,16 @@ vignette: > ### Introduction -`teal` extends the `shiny` framework, enabling the creation of interactive GUI applications using the `R`. -`shiny`, and `teal`facilitate the development of extensive applications through combining small, decoupled modules. -The `teal.modules.general` package consist of collection of modules essential for developing `teal` applications. -It is "general" in the sense that the intended functions of these modules are more fundamental. This contrasts with the more specialized focus on clinical data found in the `teal.modules.clinical` package. +`teal` extends the `shiny` framework, enabling the creation of interactive GUI applications using the `R`. +`shiny`, and `teal`facilitate the development of extensive applications through combining small, decoupled modules. +The `teal.modules.general` package consist of collection of modules essential for developing `teal` applications. +It is "general" in the sense that the intended functions of these modules are more fundamental. This contrasts with the more specialized focus on clinical data found in the `teal.modules.clinical` package. The modules from `teal.modules.general` can be used in conjunction with modules from `teal.modules.clinical` and / or other `shiny` modules to build a large `teal` / `shiny` app. The concepts presented here require knowledge about the core features of `teal`, specifically on how to launch a `teal` -application and how to pass data into it. Therefore, it is highly recommended to refer to the [`README`](https://insightsengineering.github.io/teal/index.html) file and +application and how to pass data into it. Therefore, it is highly recommended to refer to the [`README`](https://insightsengineering.github.io/teal/index.html) file and the introductory [vignette](https://insightsengineering.github.io/teal/latest-tag/articles/getting-started-with-teal.html) of the `teal` package. See also `teal.modules.clinical`'s [`README`](https://insightsengineering.github.io/teal.modules.clinical/latest-tag/index.html). @@ -39,10 +39,11 @@ See [package functions / modules](https://insightsengineering.github.io/teal.mod ### Example application A simple application featuring the `tm_variable_browser()` module: -```{r, message = FALSE, results = "hide"} +```{r app, message = FALSE, results = "hide"} # load libraries library(teal.modules.general) library(teal.widgets) +library(sparkline) # teal_data object data <- teal_data() @@ -69,12 +70,28 @@ app <- init( ) ``` -```{r, eval = FALSE} +```{r shinyapp, eval = FALSE} shinyApp(app$ui, app$server) ``` +### Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` + Let's break the above app into pieces: 1: Load the necessary libraries and data. diff --git a/vignettes/using-association-plot.Rmd b/vignettes/using-association-plot.Rmd index dc4660cb8..b303ff9b7 100644 --- a/vignettes/using-association-plot.Rmd +++ b/vignettes/using-association-plot.Rmd @@ -19,7 +19,7 @@ This vignette will guide you through the four parts to create a `teal` applicati ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets ``` @@ -33,7 +33,7 @@ Inside this app 4 datasets will be used 3. `ADTTE` A long data set with time to event data 4. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL %>% @@ -56,7 +56,7 @@ join_keys(data) <- default_cdisc_join_keys[datanames] This is the most important section. We will use the `teal::init()` function to create an app. The data will be handed over using `teal.data::teal_data()`. The app itself will be constructed by multiple calls of `tm_g_association()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for a single wide dataset mod1 <- tm_g_association( label = "Single wide dataset", @@ -296,8 +296,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-bivariate-plot.Rmd b/vignettes/using-bivariate-plot.Rmd index 518692b38..a13de8866 100644 --- a/vignettes/using-bivariate-plot.Rmd +++ b/vignettes/using-bivariate-plot.Rmd @@ -20,7 +20,7 @@ various types of datasets using the bivariate plot module `tm_g_bivariate()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets ``` @@ -35,7 +35,7 @@ Inside this app 4 datasets will be used 3. `ADTTE` A long data set with time to event data 4. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL %>% @@ -61,7 +61,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_g_bivariate()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide dataset mod1 <- tm_g_bivariate( label = "Single wide dataset", @@ -622,8 +622,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-cross-table.Rmd b/vignettes/using-cross-table.Rmd index fd0c98b6d..73c823003 100644 --- a/vignettes/using-cross-table.Rmd +++ b/vignettes/using-cross-table.Rmd @@ -20,9 +20,10 @@ various types of datasets using the cross table module `tm_t_crosstable()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets +library(rtables) ``` ## 2 - Create data sets @@ -32,7 +33,7 @@ Inside this app 2 datasets will be used 1. `ADSL` A wide data set with subject data 2. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide", echo=2:6} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide", echo=2:6} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -55,7 +56,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_t_crosstable()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide dataset mod1 <- tm_t_crosstable( label = "Single wide dataset", @@ -138,8 +139,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-data-table.Rmd b/vignettes/using-data-table.Rmd index c1a34f450..686f61b14 100644 --- a/vignettes/using-data-table.Rmd +++ b/vignettes/using-data-table.Rmd @@ -20,7 +20,7 @@ various types of datasets using the data table module `tm_data_table()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app ``` @@ -32,7 +32,7 @@ Inside this app 3 datasets will be used 2. `ADTTE` A long data set with time to event data 3. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -51,7 +51,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The app itself will be constructed by multiple calls of `tm_data_table()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the two-datasets example mod1 <- tm_data_table( label = "Two datasets", @@ -106,11 +106,29 @@ app <- init( ## 4 - Run the app -A simple `shiny::shinyApp()` call will let you run the app. -Note that app is only displayed when running this code inside an `R` session. +A simple `shiny::shinyApp()` call will let you run the app. +Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-outliers-module.Rmd b/vignettes/using-outliers-module.Rmd index 9ed56f0ad..1d6ca8536 100644 --- a/vignettes/using-outliers-module.Rmd +++ b/vignettes/using-outliers-module.Rmd @@ -20,7 +20,7 @@ various types of datasets using the outliers module `tm_outliers()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets ``` @@ -33,7 +33,7 @@ Inside this app 3 datasets will be used 2. `ADRS` A long data set with response data for subjects at different time points of the study 3. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -52,7 +52,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_outliers()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide dataset mod1 <- tm_outliers( label = "Single wide dataset", @@ -187,11 +187,29 @@ app <- init( ``` ## 4 - Run the app -A simple `shiny::shinyApp()` call will let you run the app. -Note that app is only displayed when running this code inside an `R` session. +A simple `shiny::shinyApp()` call will let you run the app. +Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-regression-plots.Rmd b/vignettes/using-regression-plots.Rmd index 93d901012..94c8aac14 100644 --- a/vignettes/using-regression-plots.Rmd +++ b/vignettes/using-regression-plots.Rmd @@ -21,7 +21,7 @@ various types of datasets using the regression plot module `tm_a_regression()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets ``` @@ -35,7 +35,7 @@ Inside this app 4 datasets will be used 3. `ADTTE` A long data set with time to event data 4. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL %>% @@ -61,7 +61,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_a_regression()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide dataset mod1 <- tm_a_regression( label = "Single wide dataset", @@ -269,8 +269,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-response-plot.Rmd b/vignettes/using-response-plot.Rmd index 415f095f7..f8054e4c8 100644 --- a/vignettes/using-response-plot.Rmd +++ b/vignettes/using-response-plot.Rmd @@ -20,7 +20,7 @@ various types of datasets using the response plot module `tm_g_response()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets ``` @@ -34,7 +34,7 @@ Inside this app 4 datasets will be used 3. `ADTTE` A long data set with time to event data 4. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL %>% @@ -60,7 +60,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_g_response()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide dataset mod1 <- tm_g_response( label = "Single wide dataset", @@ -378,8 +378,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-scatterplot-matrix.Rmd b/vignettes/using-scatterplot-matrix.Rmd index befb643fb..c89490ad4 100644 --- a/vignettes/using-scatterplot-matrix.Rmd +++ b/vignettes/using-scatterplot-matrix.Rmd @@ -21,9 +21,10 @@ various types of datasets using the scatter plot matrix module `tm_g_scatterplot ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets +library(lattice) ``` ## 2 - Create data sets @@ -35,7 +36,7 @@ Inside this app 4 datasets will be used 3. `ADTTE` A long data set with time to event data 4. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL %>% @@ -61,7 +62,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_g_scatterplotmatrix()` using different combinations of data sets. -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide dataset mod1 <- tm_g_scatterplotmatrix( label = "Single wide dataset", @@ -156,8 +157,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +``` diff --git a/vignettes/using-scatterplot.Rmd b/vignettes/using-scatterplot.Rmd index 58e42ef92..bd28df325 100644 --- a/vignettes/using-scatterplot.Rmd +++ b/vignettes/using-scatterplot.Rmd @@ -21,9 +21,12 @@ various types of datasets using the scatter plot module `tm_g_scatterplot()`: ## 1 - Load libraries -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} library(teal.modules.general) # used to create the app library(dplyr) # used to modify data sets +library(ggpmisc) +library(ggExtra) +library(colourpicker) ``` ## 2 - Create data sets @@ -35,7 +38,7 @@ Inside this app 4 datasets will be used 3. `ADTTE` A long data set with time to event data 4. `ADLB` A long data set with lab measurements for each subject -```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL %>% @@ -61,13 +64,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The itself will be constructed by multiple calls of `tm_g_scatterplot()` using different combinations of data sets. -```{r ggExtra, include = FALSE} -ggextra_available <- requireNamespace("ggExtra", quietly = TRUE) -``` -```{r, include = !ggextra_available} -# NOTE: The code will not be run as package ggExtra is not installed. -``` -```{r, eval = ggextra_available, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"} # configuration for the single wide datasets mod1 <- tm_g_scatterplot( label = "Single wide dataset", @@ -376,8 +373,26 @@ app <- init( A simple `shiny::shinyApp()` call will let you run the app. Note that app is only displayed when running this code inside an `R` session. -```{r, echo=TRUE, results="hide", eval=base::interactive()} +```{r shinyapp, echo=TRUE, results="hide", eval=base::interactive()} shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024)) ``` + +## 5 - Try it out in Shinylive + +```{r shinylive_url, echo = FALSE, results = 'asis'} +code <- paste0(c( + knitr::knit_code$get("library"), + knitr::knit_code$get("data"), + knitr::knit_code$get("app"), + knitr::knit_code$get("shinyapp") +), collapse = "\n") + +url <- roxy.shinylive::create_shinylive_url(code) +cat(sprintf("[Open in Shinylive](%s)\n\n", url)) +``` + +```{r shinylive_iframe, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")} +knitr::include_url(url, height = "800px") +```