-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathINSTALL.sh
More file actions
46 lines (41 loc) · 1.23 KB
/
INSTALL.sh
File metadata and controls
46 lines (41 loc) · 1.23 KB
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
#
# Script to install the required R packages for CosmoWrapper
#
#Check for an R installation
P_R=`which R`
if [ "${P_R}" == ""]
then
echo ERROR: There is no R executable in the PATH
exit 1
fi
#Install the required packages
R --no-restore --no-save <<EOF
qrequire<-function(...) suppressWarnings(suppressPackageStartupMessages(require(...)))
require.and.load<-function(name,githubrep,force=FALSE) {
if (!qrequire(name,character.only=TRUE) || force) {
if (!missing(githubrep)) {
devtools::install_github(paste(githubrep,name,sep='/'),upgrade='always')
} else {
install.packages(name,repos='https://cloud.r-project.org/')
}
if (grepl('/',name) & !missing(githubrep)) {
name<-rev(strsplit(name,'/')[[1]])[1]
}
if (!qrequire(name,character.only=TRUE)) {
stop(paste("Failed to install package",name))
}
}
}
require.and.load('devtools')
require.and.load('RColorBrewer')
require.and.load('matrixStats')
require.and.load('data.table')
require.and.load('helpRfuncs','AngusWright')
require.and.load('FITSio')
require.and.load('foreach')
require.and.load('doParallel')
require.and.load('itertools')
require.and.load('astro')
require.and.load('kohonen/kohonen','AngusWright')
EOF
#Finish