Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
auto-install missing dependencies
  • Loading branch information
HendrikSchultheis committed Apr 7, 2020
1 parent 89e1f3c commit f06d25f
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions wilson-basic/app.R
Expand Up @@ -3,15 +3,16 @@
# Basic App
#

# Dependency check
if(!requireNamespace("wilson", quietly = TRUE)) { stop("The package wilson needs to be installed in order to use this app.")}
if(!requireNamespace("shinydashboard", quietly = TRUE)) { stop("The package shinydashboard needs to be installed in order to use this app.")}
if(!requireNamespace("shinythemes", quietly = TRUE)) { stop("The package shinythemes needs to be installed in order to use this app.")}
if(!requireNamespace("shinyBS", quietly = TRUE)) { stop("The package shinyBS needs to be installed in order to use this app.")}
if(!requireNamespace("htmltools", quietly = TRUE)) { stop("The package htmltools needs to be installed in order to use this app.")}
# Check and Load dependencies
dependencies <- c("wilson", "shiny", "shinydashboard", "shinythemes", "shinyBS", "shinyjs", "log4r")

if (!requireNamespace("pacman", quietly = TRUE)) {
install.packages("pacman")
}
pacman::p_load(char = dependencies)

# Set versions
wilson_app_version <- "WIlsON basic 2.1.0"
wilson_app_version <- "WIlsON basic 2.1.1"
wilson_package_version <- as.character(packageVersion("wilson"))

#
Expand All @@ -25,7 +26,7 @@ wilson_mainpanelwidth <- Sys.getenv("WILSON_MAINPANELWIDTH", unset = 10)

# Which page should the user land on - default is the Introdcution page
wilson_landing_page <- Sys.getenv("WILSON_LANDING_PAGE", unset = "introduction")
if(!wilson_landing_page %in% c("introduction", "feature_selection")) {
if (!wilson_landing_page %in% c("introduction", "feature_selection")) {
wilson_landing_page <- "introduction"
}

Expand Down Expand Up @@ -80,15 +81,6 @@ version_info <- paste0("---- VERSIONS ----\n",
"App: ", wilson_app_version, "\n",
"Package: ", wilson_package_version)

# Load packages
library(shiny)
library(shinydashboard)
library(shinyjs)
library(shinyBS)
library(shinythemes)
library(log4r)
library(wilson)

# Define the UI
ui <- dashboardPage(header = dashboardHeader(disable = TRUE), sidebar = dashboardSidebar(disable = TRUE),
body = dashboardBody(
Expand Down

0 comments on commit f06d25f

Please sign in to comment.