R/beanz_shiny.R

Defines functions bzShiny

Documented in bzShiny

##-----------------------------------------------------------------------------------
##                     run Shiny Gui
##-----------------------------------------------------------------------------------
#' Run Web-Based BEANZ application
#'
#' Call Shiny to run \code{beanz} as a web-based application
#'
#' @export
#'
bzShiny <- function() {
    if (!requireNamespace("shiny", quietly = TRUE)) {
        stop("Shiny needed for this function to work. Please install it.",
             call. = FALSE)
    }

    if (!requireNamespace("shinythemes", quietly = TRUE)) {
        stop("shinythemes needed for this function to work. Please install it.",
             call. = FALSE)
    }

    if (!requireNamespace("DT", quietly = TRUE)) {
        stop("DT needed for this function to work. Please install it.",
             call. = FALSE)
    }


    appDir <- system.file("shiny", package = "beanz")
    if (appDir == "") {
        stop("Could not find Shiny directory. Try re-installing `beanz`.",
             call. = FALSE)
    }

    shiny::runApp(appDir, display.mode = "normal");
}

Try the beanz package in your browser

Any scripts or data that you put into this service are public.

beanz documentation built on Aug. 9, 2023, 5:09 p.m.