generated from OpenOmics/project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackages.R
executable file
·42 lines (38 loc) · 1 KB
/
packages.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
#!/usr/bin/env Rscript
# CRAN packages,
# add any missing/required
# CRAN packages to the list
# directly below. This script
# will install them if they
# are not already installed.
# Install via:
# install.packages('packageName', repos='http://cran.r-project.org')
cran_packages <- c(
"BiocManager",
"ggplot2"
)
# Install missing CRAN packages
install.packages(
setdiff(
cran_packages, rownames(installed.packages())
),
repos = 'http://cran.r-project.org'
)
# Bioconductor packages,
# add any missing/required
# Bioconductor packages to the list
# directly below. This script will
# install them if they are missing.
# Install via:
# BiocManager::install('packageName')
bioc_packages <- c(
"limma"
)
# Install missing Bioconductor packages
for (p in bioc_packages){
if (!p %in% rownames(installed.packages())){
# Package missing
print(paste("Installing missing Bioconductor package...", p))
BiocManager::install(p, ask = FALSE, update = FALSE)
}
}