From 4a86bd6fac8bf537a48b57afe2e919e4d248f899 Mon Sep 17 00:00:00 2001 From: Federico Marini Date: Fri, 4 Oct 2024 14:10:23 +0200 Subject: [PATCH] expanding a bit on the main example --- R/iSEEindex.R | 29 +++++++++++++++++++++++++++++ man/iSEEindex.Rd | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/R/iSEEindex.R b/R/iSEEindex.R index edaba54..4f3148d 100644 --- a/R/iSEEindex.R +++ b/R/iSEEindex.R @@ -193,6 +193,35 @@ #' if (interactive()) { #' shiny::runApp(app_tonsils, port = 5678) #' } +#' +#' +#' ## This example shows that it is possible to mix different types of resources +#' ## Some provide the path, some directly the object +#' +#' dataset_fun_mix <- function() { +#' x <- yaml::read_yaml( +#' system.file("mixed_resources.yml", package = "iSEEindex") +#' ) +#' x$datasets +#' } +#' initial_fun_mix <- function() { +#' x <- yaml::read_yaml( +#' system.file("mixed_resources.yml", package = "iSEEindex") +#' ) +#' x$initial +#' } +#' +#' app_mixed <- iSEEindex(bfc, +#' dataset_fun_mix, +#' initial_fun_mix, +#' default.add = TRUE, +#' default.position = "last", +#' app.title = "iSEE ❤ multiple resource types") +#' +#' if (interactive()) { +#' shiny::runApp(app_mixed, port = 4242) +#' } +#' iSEEindex <- function(bfc, FUN.datasets, FUN.initial = NULL, diff --git a/man/iSEEindex.Rd b/man/iSEEindex.Rd index 3dfaf4e..f70b64b 100644 --- a/man/iSEEindex.Rd +++ b/man/iSEEindex.Rd @@ -212,6 +212,35 @@ app_tonsils <- iSEEindex(bfc, if (interactive()) { shiny::runApp(app_tonsils, port = 5678) } + + +## This example shows that it is possible to mix different types of resources +## Some provide the path, some directly the object + +dataset_fun_mix <- function() { + x <- yaml::read_yaml( + system.file("mixed_resources.yml", package = "iSEEindex") + ) + x$datasets +} +initial_fun_mix <- function() { + x <- yaml::read_yaml( + system.file("mixed_resources.yml", package = "iSEEindex") + ) + x$initial +} + +app_mixed <- iSEEindex(bfc, + dataset_fun_mix, + initial_fun_mix, + default.add = TRUE, + default.position = "last", + app.title = "iSEE ❤ multiple resource types") + +if (interactive()) { + shiny::runApp(app_mixed, port = 4242) +} + } \author{ Kevin Rue-Albrecht