diff options
author | Naeem Model <me@nmode.ca> | 2025-01-06 23:55:43 +0000 |
---|---|---|
committer | Naeem Model <me@nmode.ca> | 2025-01-06 23:55:43 +0000 |
commit | e920b3e514e717fc05ed524267d3b53e272fec51 (patch) | |
tree | 353cfb36aca946d69da6d6dcacc0cb66177050ef /R | |
parent | 2d34b71c7a8da7fd0fac59b934145286b2be7b1f (diff) |
Update web app entry point
- Rename 'app' -> 'web'
- Return shiny app object in entry point function
Diffstat (limited to 'R')
-rw-r--r-- | R/web.R (renamed from R/app.R) | 28 |
1 files changed, 23 insertions, 5 deletions
@@ -1,17 +1,35 @@ #' Launch the Rnaught Web Application #' +#' This is the entry point of the Rnaught web application, which creates and +#' returns a Shiny app object. When invoked directly, the web application is +#' launched. +#' +#' The following dependencies are required to run the application: +#' * [shiny](https://shiny.posit.co) +#' * [bslib](https://rstudio.github.io/bslib) +#' * [DT](https://rstudio.github.io/DT) +#' * [plotly](https://plotly-r.com) +#' +#' If any of the above packages are missing during launch, a prompt will appear +#' to install them. +#' +#' To configure settings such as the port, host or default browser, set Shiny's +#' global options (see [shiny::runApp()]). +#' +#' @return A Shiny app object for the Rnaught web application. +#' #' @importFrom utils install.packages #' #' @export -app <- function() { +web <- function() { missing_pkgs <- c() # Check for any missing, required packages. - if (!requireNamespace("bslib", quietly = TRUE)) { - missing_pkgs <- c(missing_pkgs, "bslib") - } if (!requireNamespace("shiny", quietly = TRUE)) { missing_pkgs <- c(missing_pkgs, "shiny") } + if (!requireNamespace("bslib", quietly = TRUE)) { + missing_pkgs <- c(missing_pkgs, "bslib") + } if (!requireNamespace("DT", quietly = TRUE)) { missing_pkgs <- c(missing_pkgs, "DT") } @@ -35,5 +53,5 @@ app <- function() { } } - shiny::runApp(appDir = system.file("app", package = "Rnaught")) + shiny::shinyAppDir(appDir = system.file("web", package = "Rnaught")) } |