-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.R
55 lines (48 loc) · 1.7 KB
/
setup.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
installed = rownames(installed.packages())
cran_packages = c("remotes",
"fs",
"imager",
"rlang",
"here",
"maxnet",
"sf",
"stars",
"smoothr",
"ggOceanMaps",
"robis",
"rnaturalearth",
"rnaturalearthdata",
"lubridate",
"ggplot2",
"tidymodels",
"workflowsets",
"patchwork",
"tidyr",
"readr",
"tidymodels",
"tidysdm",
"dplyr")
ix = cran_packages %in% installed
for (package in cran_packages[!ix]) {
install.packages(package)
}
github_packages = c(charlier = "BigelowLab/charlier",
maxnet = "BigelowLab/maxnet",
maxnetic = "BigelowLab/maxnetic",
oisster = "BigelowLab/oisster",
nbs = "BigelowLab/nbs")
ix = names(github_packages) %in% installed
for (package in names(github_packages[!ix])) {
remotes::install_github(github_packages[[package]], upgrade = FALSE)
}
if (!("rnaturalearthhires" %in% installed)) {
install.packages("rnaturalearthhires",
repos = "http://packages.ropensci.org",
type = "source")
}
suppressPackageStartupMessages({
for (package in cran_packages) library(package, character.only = TRUE)
for (package in names(github_packages)) library(package, character.only = TRUE)
library(rnaturalearthhires)
})
for (f in list.files("functions", full.names = TRUE)) source(f, echo = FALSE)