app: Expose Shiny app object

This commit is contained in:
Elias Projahn 2025-03-05 15:31:49 +01:00
parent 766a84291b
commit a7d02bc9f2
4 changed files with 40 additions and 4 deletions

View file

@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand # Generated by roxygen2: do not edit by hand
export(analyze) export(analyze)
export(app)
export(box_plot) export(box_plot)
export(overview_plot) export(overview_plot)
export(rank_genes) export(rank_genes)

22
R/app.R
View file

@ -5,20 +5,34 @@
#' @param custom_dataset This allows to set a custom dataset (return value of #' @param custom_dataset This allows to set a custom dataset (return value of
#' [analyze()]) as the default dataset of the UI. #' [analyze()]) as the default dataset of the UI.
#' #'
#' @seealso [app()] for retrieving a Shiny app object.
#'
#' @export #' @export
run_app <- function(host = "127.0.0.1", run_app <- function(host = "127.0.0.1",
port = 3464, port = 3464,
custom_dataset = NULL) { custom_dataset = NULL) {
runApp( runApp(
shinyApp( app(custom_dataset = custom_dataset),
ui(custom_dataset = custom_dataset),
server(custom_dataset = custom_dataset)
),
host = host, host = host,
port = port port = port
) )
} }
#' Create a shiny application for Ubigen.
#'
#' @param custom_dataset This allows to set a custom dataset (return value of
#' [analyze()]) as the default dataset of the UI.
#'
#' @seealso [run_app()] for immediately running the application.
#'
#' @export
app <- function(custom_dataset = NULL) {
shinyApp(
ui(custom_dataset = custom_dataset),
server(custom_dataset = custom_dataset)
)
}
#' Run the Ubigen API. #' Run the Ubigen API.
#' #'
#' This requires the `plumber` package to be installed. #' This requires the `plumber` package to be installed.

18
man/app.Rd Normal file
View file

@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/app.R
\name{app}
\alias{app}
\title{Create a shiny application for Ubigen.}
\usage{
app(custom_dataset = NULL)
}
\arguments{
\item{custom_dataset}{This allows to set a custom dataset (return value of
\code{\link[=analyze]{analyze()}}) as the default dataset of the UI.}
}
\description{
Create a shiny application for Ubigen.
}
\seealso{
\code{\link[=run_app]{run_app()}} for immediately running the application.
}

View file

@ -17,3 +17,6 @@ run_app(host = "127.0.0.1", port = 3464, custom_dataset = NULL)
\description{ \description{
Run the application server. Run the application server.
} }
\seealso{
\code{\link[=app]{app()}} for retrieving a Shiny app object.
}