-
Notifications
You must be signed in to change notification settings - Fork 28
/
HDL.install.R
40 lines (39 loc) · 1.73 KB
/
HDL.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
##### Install HDL #####
if(!require("dplyr",character.only = TRUE)){
try_error <- try(install.packages("dplyr",
dependencies=TRUE), silent = TRUE)
if(class(try_error) == "try-error"){
try_error <- try(install.packages("dplyr",
dependencies=TRUE,
lib = Sys.getenv("R_LIBS_USER")), silent = TRUE)
}
}
if(!require("data.table",character.only = TRUE)){
try_error <- try(install.packages("data.table",
dependencies=TRUE), silent = TRUE)
if(class(try_error) == "try-error"){
try_error <- try(install.packages("data.table",
dependencies=TRUE,
lib = Sys.getenv("R_LIBS_USER")), silent = TRUE)
}
}
data.table.version <- packageVersion("data.table")
if(data.table.version < "1.12.1"){
message("Package 'data.table' needs to updated...")
try_error <- try(install.packages("data.table",
dependencies=TRUE), silent = TRUE)
if(class(try_error) == "try-error"){
try_error <- try(install.packages("data.table",
dependencies=TRUE,
lib = Sys.getenv("R_LIBS_USER")), silent = TRUE)
}
}
try_error <- try(install.packages("HDL",
repos = NULL,
type = "source"), silent = TRUE)
# if(!is.null(try_error)){
# try_error <- try(install.packages("HDL",
# repos = NULL,
# lib = Sys.getenv("R_LIBS_USER"),
# type = "source"), silent = TRUE)
# }