-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrpackages.R
35 lines (29 loc) · 1.02 KB
/
rpackages.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
Sys.setenv(TAR = "/bin/tar")
options(repos=structure(c(CRAN="https://cloud.r-project.org")))
if (!requireNamespace('BiocManager', quietly = TRUE)) {
install.packages('BiocManager')
BiocManager::install("remotes")
}
args <- commandArgs(trailingOnly=TRUE)
packages <- read.csv(args[1], stringsAsFactors = FALSE,
header = TRUE, sep = " ", comment.char = "#")
installed <- rownames(installed.packages())
for (i in 1:nrow(packages)) {
pckg_name = tail(unlist(strsplit(packages[i,1], split = "/")), n = 1)
if (pckg_name %in% installed) {
message(paste(pckg_name, "already installed"))
} else {
if (packages[i,2] == TRUE) {
INSTALL <- BiocManager::install
} else {
INSTALL <- install.packages
}
package <- packages[i,1]
message(paste("install", package))
INSTALL(packages[i,1])
message(paste("installed", package))
}
}
#library(devtools)
#install_github("immunogenomics/harmony")
#install_github("theislab/kBET")