-
Notifications
You must be signed in to change notification settings - Fork 2
/
launch.r
23 lines (18 loc) · 874 Bytes
/
launch.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#' Script to check required pakages for the 'ascr' shiny application are loaded
#' and launch the application given a user defined <path/to/ascr_shiny>
appDir <- "path/to/ascr_shiny" ## user should set "path/to/ascr_shiny" to the path to where the ascr_shiny folder is
pkgs <- c("shiny","rmarkdown", "shinyjs", "shinycssloaders","shinythemes","animation","devtools","ggplot2","gridExtra","raster","rasterVis")
options(warn = -1)
for (i in pkgs){
if (!require(i, quietly = TRUE, character.only = TRUE)){
install.packages(i)
}
}
if(!require("ascr",quietly = TRUE, character.only = TRUE) ){
devtools::install_github("b-steve/ascr")
}
if(require("ascr",quietly = TRUE, character.only = TRUE) & packageVersion("ascr") < 2.1 ){
devtools::install_github("b-steve/ascr")
}
options(warn = 0)
runApp(appDir, display.mode = "normal",launch.browser = TRUE)