R/runApp.R

Defines functions runApp

Documented in runApp

#' @title runApp
#'
#' @description A function for running the ONDRI Data Prep ShinyApp.
#'
#' @author Jedid Ahn
#' @export
#' @importFrom utils installed.packages
#' 
runApp <- function() {
  # Custom installation of OuRS package.
  if ("ours" %in% rownames(installed.packages()) == FALSE) {
    Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = TRUE)
    remotes::install_github("derekbeaton/OuRS/OuRS")
  }
  
  appDir <- system.file("shiny", package = "ONDRIDataPrepApp")
  if (appDir == "") {
    stop("Could not find shiny app. Try re-installing ONDRIDataPrepApp package.",
         call. = FALSE)
  }
  
  shiny::runApp(appDir, display.mode = "normal", launch.browser = TRUE)
}

# [END]
ahnjedid/dataprep-test documentation built on Jan. 5, 2021, 12:13 a.m.