]> nmode's Git Repositories - Rnaught/blob - R/app.R
Prompt user to install optional dependency
[Rnaught] / R / app.R
1 #' Launch the Rnaught Web Application
2 #'
3 #' @importFrom utils install.packages
4 #'
5 #' @export
6 app <- function() {
7 if (!requireNamespace("shiny", quietly = TRUE)) {
8 answer <- readline(paste0("The package 'shiny' must be installed to ",
9 "launch the Rnaught web application.\nWould you like to install it? ",
10 "[Y/n] "))
11
12 if (answer == "Y" || answer == "y")
13 install.packages("shiny")
14 else
15 stop("Aborting.", call. = FALSE)
16 }
17
18 shiny::shinyApp(ui(), server)
19 }