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