-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.R
68 lines (64 loc) · 1.7 KB
/
install.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##############
# Check that the currently install version of R
# is at least the minimum required version
##############
R_min_version <- "3.1.0"
R_version <- paste0(R.Version()$major, ".", R.Version()$minor)
if (compareVersion(R_version, R_min_version) < 0) {
stop(
"You do not have the latest required.\n",
"Launch will fail if you continue.\n",
"Go to http://cran.r-project.org/ to update your version of R."
)
}
######
# Install basic required packages if not available/installed
######
download_not_installed <- function(x) {
availpacks <- .packages(all.available = TRUE)
source("http://bioconductor.org/biocLite.R")
missingPackages <- x[!(x %in% availpacks)]
message("The following packages were missing. Installation attempted...")
message(missingPackages)
if (length(missingPackages) > 0) {
for (i in missingPackages) {
message("Installing", i, "package using biocLite...\n")
biocLite(i)
}
}
}
vanilla_install_packages <- c(
"limma",
"markdown",
"shiny",
"shinyjs",
"shinyBS",
"scales",
"markdown",
"ggplot2",
"png",
"vsn",
"RUnit",
"reshape",
"digest",
"Rcpp",
"VennDiagram",
"convert"
)
download_not_installed(vanilla_install_packages)
###################################
# Should use latest version of shiny
###################################
shiny_okay <- FALSE
if ("shiny" %in% .packages(all.available = TRUE)) {
shiny_min_version <- "0.11"
shiny_compare <- compareVersion(as.character(packageVersion("shiny")), shiny_min_version)
if (shiny_compare >= 0) {
shiny_okay <- TRUE
}
}
if (!shiny_okay) {
install.packages("devtools")
devtools::install_github("rstudio/shiny")
devtools::install_github("trestletech/shinyTable")
}