forked from seaflow-uw/popcycle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.R
More file actions
29 lines (26 loc) · 713 Bytes
/
setup.R
File metadata and controls
29 lines (26 loc) · 713 Bytes
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
try_to_install <- function(pkg) {
if (pkg %in% rownames(installed.packages())) {
return(invisible())
}
install.packages(pkg, repos='http://cran.us.r-project.org')
if (!(pkg %in% rownames(installed.packages()))) {
# Quit R with error status
q(status = 1)
}
}
try_to_install('RSQLite')
try_to_install('splancs')
try_to_install('plyr')
try_to_install('maps')
try_to_install('mapdata')
try_to_install('plotrix')
try_to_install('snow')
try_to_install('testthat')
try_to_install_local <- function(pkg) {
install.packages('.', repos=NULL, type='source')
if (!(pkg %in% rownames(installed.packages()))) {
# Quit R with error status
q(status = 1)
}
}
try_to_install_local('popcycle')