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