-
Notifications
You must be signed in to change notification settings - Fork 0
/
Demo2_ReLTER_intro.Rmd
191 lines (136 loc) · 4.74 KB
/
Demo2_ReLTER_intro.Rmd
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
title: "Introducing `ReLTER`"
author: "Alessandro Oggioni, Micha Silver, Paulo Tagliolato"
date: "3/01/2023"
output:
ioslides_presentation:
smaller: true
logo: figures/eLTER_logo.png
css: styles.css
---
```{r relter-setup, include=FALSE, purl=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
```
## What is ReLTER
#### As a reminder
- Clone the github repository: https://github.com/micha-silver/ReLTER_demo
- Review the first video: https://youtu.be/Y037HJH34g4
- Install `ReLTER` from github:
```{r relter-loading, message=FALSE, warning=FALSE}
if (!require("ReLTER", quietly = TRUE))
remotes::install_github("ropensci/ReLTER")
# Convenient way to load list of additional packages
pkg_list <- c("sf", "terra", "ReLTER", "tmap")
lapply(pkg_list,require, character.only = TRUE)
tmap_options(check.and.fix = TRUE)
tmap_mode("view")
```
----
#### Package Maintainer
```{r relter-maintainer}
library(ReLTER)
maintainer("ReLTER")
```
#### How to cite
```{r relter-citation}
citation("ReLTER")
```
----
#### Package functions
```{r relter-functions}
head(ls("package:ReLTER"), 30)
```
----
#### Categories of functions
- site specific functions
- network functions
- metadata functions
- taxonomy functions
#### Access to external data
- Species occurrence
- Species taxonomy
- European spatial data
- MODIS products
----
#### Key functions:
- `get_ilter_generalinfo()`
- `get_site_info()`
- `get_network_sites()`
- `get_site_speciesOccurrences()`
- `get_site_ODS()`
- `get_site_MODIS()`
## Examples
Search for DEIMS ID for a particular site. The function `get_ilter_generalinfo` allows to search by country name and site name. Then `get_site_info()` obtains various metadata about a chosen site.
#### For the first example, the **Doñana LTSER Platform** in Spain
```{r relter-donana}
donana = get_ilter_generalinfo(country_name = "Spain",
site_name = "Doñana")
(donana_id = donana$uri)
```
----
Plot a basic map of that site. We use the `tmap` package for viewing maps.
```{r relter-plot-donana}
donana_polygon <- get_site_info(donana_id, category = "Boundaries")
tm_basemap("OpenStreetMap.Mapnik") +
tm_shape(donana_polygon) +
tm_fill(col = "blue", alpha = 0.3)
```
----
Get species occurrence data for Doñana using the `get_site_speciesOccurrences()` function. This function downloads data from one of the global biodiversity information sites.
In this case, GBIF: https://www.gbif.org/
```{r relter-species-donana}
species_occur <- get_site_speciesOccurrences(donana_id,
list_DS = "gbif", limit=12)
colnames(species_occur$gbif)
```
----
Display some variables from GBIF
```{r relter-species-variables}
dplyr::select(species_occur$gbif, name, eventDate)
```
----
#### Next example: Metadata from **Loch Kinord** in Scotland.
Note that partial matching is supported by `get_ilter_generalinfo()`. i.e. "United K"
```{r relter-kinord-info}
loch_kinord <- get_ilter_generalinfo(country_name = "United K",
site_name = "Loch Kinord")
(loch_kinord_id = loch_kinord$uri)
loch_kinord_details <- get_site_info(loch_kinord_id,
c("Contacts", "EnvCharacts", "Parameters"))
print(paste("Site manager:",
loch_kinord_details$generalInfo.siteManager[[1]]['name'],
loch_kinord_details$generalInfo.siteManager[[1]]['email']))
```
----
Environment Characteristics
```{r relter-kinord-envcharacteristics}
print(paste("Annual average air temperature:",
loch_kinord_details$envCharacteristics.airTemperature.yearlyAverage))
print(paste("Annual precipitation:",
loch_kinord_details$envCharacteristics.precipitation.yearlyAverage))
```
----
Biome, vegetation
```{r relter-kinord-geobonbiome}
print(paste("GeoBonBiome: ",
loch_kinord_details$envCharacteristics.geoBonBiome))
loch_kinord_vegetation <- loch_kinord_details$envCharacteristics.vegetation
cat("Vegetation: \n", stringr::str_wrap(loch_kinord_vegetation, 70))
```
----
#### Next example: Query the **LTER network in Slovakia**
```{r elter-slovakia, message=FALSE, warning=FALSE}
lter_slovakia_id = "https://deims.org/networks/3d6a8d72-9f86-4082-ad56-a361b4cdc8a0"
lter_slovakia_sites <- get_network_sites(lter_slovakia_id)
lter_slovakia_sites$title
```
----
#### Show map of sites in the network
```{r relter-slovakia-map, message=FALSE, warning=FALSE}
lter_slovakia <- produce_network_points_map(lter_slovakia_id, "SVK")
svk <- readRDS("gadm36_SVK_0_sp.rds") # downloaded by produce_network_points_map()
tm_basemap("OpenStreetMap.Mapnik") +
lter_slovakia +
tm_shape(svk) + tm_borders(col = "blue", lwd = 1) +
tm_scale_bar(position = c("right", "bottom"))
```