R/run_optistock_app.R

Defines functions optistock_app

Documented in optistock_app

#' Run Shiny app to create sandbox optistock CPF curves
#'
#' This function will open a Shiny app where you can play around with parameters
#' to see how the resulting CPF curve will change.
#'
#' @return NULL. Opens and runs the Shiny application that comes with the
#' \code{optistock} package
#'
#' @export
optistock_app <- function() {
    appDir <- system.file("optistock_app", package = "optistock")
    if (appDir == "") {
      stop("Could not find example directory. Try re-installing `optistock`.",
           call. = FALSE)
    }
    if (!requireNamespace("shiny", quietly = TRUE)) {
      stop("The shiny package is required to run this app. \n",
           "Install it with install.packages(\"shiny\")")
    }

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

Try the optistock package in your browser

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

optistock documentation built on Aug. 24, 2023, 5:06 p.m.