Allow setting a custom default dataset

This commit is contained in:
Elias Projahn 2022-12-02 15:16:37 +01:00
parent c14208c2b2
commit 995b31646e
4 changed files with 203 additions and 177 deletions

15
R/app.R
View file

@ -2,8 +2,19 @@
#'
#' @param host The hostname to serve the application on.
#' @param port The port to serve the application on.
#' @param custom_dataset This allows to set a custom dataset (return value of
#' [analyze()]) as the default dataset of the UI.
#'
#' @export
run_app <- function(host = "127.0.0.1", port = 3464) {
runApp(shinyApp(ui, server), host = host, port = port)
run_app <- function(host = "127.0.0.1",
port = 3464,
custom_dataset = NULL) {
runApp(
shinyApp(
ui(custom_dataset = custom_dataset),
server(custom_dataset = custom_dataset)
),
host = host,
port = port
)
}