summaryrefslogtreecommitdiff
path: root/R/app.R
blob: 945f9e4634d61a2052d3d0ccde41071959b18d54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#' Launch the Rnaught Web Application
#'
#' @importFrom utils install.packages
#'
#' @export
app <- function() {
  if (!requireNamespace("shiny", quietly = TRUE)) {
    answer <- readline(paste0("The package 'shiny' must be installed to ",
      "launch the Rnaught web application.\nWould you like to install it? ",
      "[Y/n] "))

    if (answer == "Y" || answer == "y")
      install.packages("shiny")
    else
      stop("Aborting.", call. = FALSE)
  }

  shiny::shinyApp(ui(), server)
}