-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch_app.R
30 lines (30 loc) · 1.36 KB
/
launch_app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Check R version
x = readLines("http://cran.r-project.org/sources.html")
# the version number is in the next line of 'The latest release'
relver = gsub("(.*R-|\\.\\d\\.tar\\.gz.*)", "", x[grep("latest release", x) + 1L])
myver = substr(getRversion(),1,3)
# new version available?
# message("Installed major version: ", myver)
# message("Latest major version: ", relver)
vcheck <- compareVersion(relver, myver)
if(vcheck == 1){
message(R.version$version.string)
stop(sprintf("Please install R version %s or higher",relver))
}
# Check initial dependencies
initial.libs <- c("shinydashboard", "shiny", "shinyjs", "shinyBS", "DT","BiocManager")
options(install.packages.check.source = "no")
options(install.packages.compile.from.source = "never")
if (!require("pacman")) install.packages("pacman"); library(pacman)
p_load(initial.libs, try.bioconductor=TRUE, character.only = TRUE)
status <- sapply(initial.libs,require,character.only = TRUE)
if(all(status)){
print("All initial libraries successfully installed and loaded.")
} else {
print(paste("ERROR: One or more libraries failed to install correctly.",
status))
}
# Launch shiny app
shiny::runGitHub('Interactive-Enrichment-Analysis', 'gladstone-institutes',
subdir = 'shiny_run/app', destdir = file.path(getwd(),"Interactive-Enrichment-Analysis"),
launch.browser= TRUE)