-
Notifications
You must be signed in to change notification settings - Fork 15
/
install.R
81 lines (72 loc) · 3.04 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
69
70
71
72
73
74
75
76
77
78
79
80
81
## This file is part of coronet, which is free software: you
## can redistribute it and/or modify it under the terms of the GNU General
## Public License as published by the Free Software Foundation, version 2.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##
## Copyright 2014 by Roger Meier <[email protected]>
## Copyright 2015 by Andreas Ringlstetter <[email protected]>
## Copyright 2015 by Wolfgang Mauerer <[email protected]>
## Copyright 2015-2017 by Claus Hunsen <[email protected]>
## Copyright 2017 by Thomas Bock <[email protected]>
## Copyright 2020-2023 by Thomas Bock <[email protected]>
## Copyright 2019 by Anselm Fehnker <[email protected]>
## Copyright 2021 by Christian Hechtl <[email protected]>
## All Rights Reserved.
##
## Adapted from https://github.com/siemens/codeface/blob/be382e9171fb91b4aa99b99b09b2ef64a6dba0d5/packages.r
## to our needs.
packages = c(
"yaml",
"R6",
"igraph",
"plyr",
"parallel",
"logging",
"sqldf",
"data.table",
"reshape2",
"testthat",
"patrick",
"ggplot2",
"ggraph",
"markovchain",
"lubridate",
"viridis",
"jsonlite",
"rTensor",
"Matrix"
)
filter.installed.packages = function(packageList) {
if ("-f" %in% commandArgs(trailingOnly = TRUE)) {
return(packageList)
} else {
return(packageList[which(packageList %in% installed.packages()[, 1] == FALSE)])
}
}
p = filter.installed.packages(packages)
if (length(p) > 0) {
print(sprintf("Installing package '%s'.", p))
## set dependencies to 'NA' to install only necessary dependencies (i.e., "Depends", "Imports", "LinkingTo")
install.packages(p, dependencies = NA, verbose = TRUE, quiet = TRUE)
igraph.version = installed.packages()[rownames(installed.packages()) == "igraph", "Version"]
if (compareVersion(igraph.version, "1.3.0") == -1) {
print("WARNING: igraph version 1.3.0 or higher is recommended for using coronet.")
}
Matrix.version = installed.packages()[rownames(installed.packages()) == "Matrix", "Version"]
if (compareVersion(Matrix.version, "1.3.0") == -1) {
print("WARNING: Matrix version 1.3.0 or higher is necessary for using coronet. Re-install package Matrix...")
install.packages("Matrix", dependencies = NA, verbose = TRUE, quiet = TRUE)
Matrix.version = installed.packages()[rownames(installed.packages()) == "Matrix", "Version"]
if (compareVersion(Matrix.version, "1.3.0") == -1) {
print("WARNING: Re-installation of package Matrix did not end up in the necessary packge version.")
}
}
}