forked from ccmothes/Geospatial-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.R
More file actions
32 lines (26 loc) · 669 Bytes
/
setup.R
File metadata and controls
32 lines (26 loc) · 669 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
# Set up script
# function to check for package installation, then install and load libraries
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('tidyverse',
'palmerpenguins',
'sf',
'terra',
'tmap',
'rmarkdown',
'tigris',
'elevatr',
'rgbif',
'soilDB',
'plotly',
'mapview',
"leaflet")
packageLoad(packages)