-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.R
More file actions
51 lines (41 loc) · 888 Bytes
/
setup.R
File metadata and controls
51 lines (41 loc) · 888 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# setup script for processing functions
#Install (if necessary) and load all required packages ----------------
packageLoad <-
function(x) {
for (i in 1:length(x)) {
if (!x[i] %in% installed.packages()) {
install.packages(x[i])
}
library(x[i], character.only = TRUE)
}
}
# vector of packages to load
packages <- c(
'sf',
'terra',
'tidyverse',
'leaflet',
'shiny',
'shinyWidgets',
'bslib',
'plotly',
'tigris',
'rnaturalearth',
'rnaturalearthdata',
'geodata',
'remotes',
'scales'
)
packages <- c(packages)
packageLoad(packages)
if (!"rnaturalearthhires" %in% installed.packages()) {
remotes::install_github("ropensci/rnaturalearthhires")
}
# source all functions --------------------------
# purrr::map(list.files(
# path = "src/",
# pattern = "*.R",
# full.names = TRUE,
# recursive = TRUE
# ),
# source)