-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
92 lines (65 loc) · 2.04 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# biooracler
<!-- badges: start -->
<!-- badges: end -->
`biooracler` provides access to the [Bio-Oracle](https://bio-oracle.org/) dataset via ERDDAP server. It will partly replace [sdmpredictors](https://github.com/lifewatch/sdmpredictors).
## Installation
You can install the development version of biooracler from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("bio-oracle/biooracler")
```
## List Layers
You can look-up available layers or search specific environmental variables.
### Search available layers
```{r}
library(biooracler)
list_layers("Ocean Temperature")
```
### See all available layers
```{r}
list_layers()
```
### See all information of all layers
```{r}
list_layers(simplify = FALSE)
```
## Layer information
```{r}
info_layer("tas_baseline_2000_2020_depthsurf")
```
## Download layers
First you need to define dataset to download together with the time, latitude and longitude constrains. The constains must be provided as a named list containing at least one of: time, latitude or longitude.
```{r}
dataset_id <- "tas_baseline_2000_2020_depthsurf"
time = c('2001-01-01T00:00:00Z', '2010-01-01T00:00:00Z')
latitude = c(10, 20)
longitude = c(120, 130)
constraints = list(time, latitude, longitude)
names(constraints) = c("time", "latitude", "longitude")
```
Define also the variables to download:
```{r}
variables = c("tas_max", "tas_min")
```
Perform download
```{r}
layers <- download_layers(dataset_id, variables, constraints)
```
You can modify the download path and the output type with the arguments `directory` and `fmt` respectively.
```{r}
dir <- tempdir()
download_layers(dataset_id, variables, constraints, fmt = "csv", directory = dir)
download_layers(dataset_id, variables, constraints, fmt = "raster", directory = dir)
```