]>
nmode's Git Repositories - Rnaught/blob - R/app.R
01f35b470ff5e13726a2186756f1c06bf2c0fbae
1 #' Launch the Rnaught Web Application
3 #' @importFrom utils install.packages
8 # Check for any missing, required packages.
9 if (!requireNamespace("shiny", quietly
= TRUE)) {
10 missing_pkgs
<- c(missing_pkgs
, "shiny")
12 if (!requireNamespace("bslib", quietly
= TRUE)) {
13 missing_pkgs
<- c(missing_pkgs
, "bslib")
15 if (!requireNamespace("DT", quietly
= TRUE)) {
16 missing_pkgs
<- c(missing_pkgs
, "DT")
19 # If any of the required packages are missing,
20 # prompt the user to install them.
21 if (length(missing_pkgs
) > 0) {
22 cat("The following packages must be installed to run the",
23 "Rnaught web application:\n"
25 writeLines(missing_pkgs
)
26 answer
<- readline("Begin installation? [Y/n] ")
28 if (answer
== "Y" || answer
== "y") {
29 install.packages(missing_pkgs
)
31 stop("Aborting due to missing, required packages.", call.
= FALSE)
35 shiny
::runApp(appDir
= system.file("app", package
= "Rnaught"))