summaryrefslogtreecommitdiff
path: root/R/app.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/app.R')
-rw-r--r--R/app.R16
1 files changed, 13 insertions, 3 deletions
diff --git a/R/app.R b/R/app.R
index feb052f..945f9e4 100644
--- a/R/app.R
+++ b/R/app.R
@@ -1,9 +1,19 @@
#' Launch the Rnaught Web Application
#'
+#' @importFrom utils install.packages
+#'
#' @export
app <- function() {
- if (!requireNamespace("shiny", quietly = TRUE))
- stop("The package 'shiny' must be installed to launch the Rnaught web application.")
+ 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)
+ shiny::shinyApp(ui(), server)
}