forked from NetManAIOps/CIRCA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequirements.R
40 lines (37 loc) · 956 Bytes
/
requirements.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
get_os <- function() {
os <- .Platform$OS.type
if (os == "unix") {
sysinf <- Sys.info()
if (!is.null(sysinf)) {
if (sysinf["sysname"] == "Darwin") {
os <- "osx"
}
if (startsWith(sysinf["machine"], "arm")) {
os <- sprintf("%s-%s", os, sysinf["machine"])
}
} else if (grepl("^darwin", R.version$os)) {
os <- "osx"
}
} # else "windows"
os
}
os <- get_os()
install_packages <- function(pkgs, ...) {
if (os == "osx") {
install.packages(pkgs, type = "mac.binary", ...)
} else if (os == "windows") {
install.packages(pkgs, type = "win.binary", ...)
} else {
install.packages(pkgs, ...)
}
}
# pcalg
install_packages("BiocManager")
# igraph is required by ggm
install_packages("igraph")
library(igraph)
BiocManager::install(c("graph", "RBGL", "ggm"), ask = FALSE)
install_packages("pcalg")
# test installation
library(pcalg)
install_packages(c("ggplot2", "xtable"))