-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_xc_recordings.qmd
76 lines (47 loc) · 1.6 KB
/
get_xc_recordings.qmd
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
---
date: "`r Sys.Date()`"
toc: true
toc-depth: 3
toc-location: left
number-sections: true
highlight-style: pygments
format:
html:
df-print: kable
code-fold: show
code-tools: true
css: styles.css
link-external-icon: true
link-external-newwindow: true
---
::: {.alert .alert-info}
## **Objetive** {.unnumbered .unlisted}
- Demonstrate how to obtain acoustic data from online repositories
:::
<font size="4">
## Getting recordings from Xeno-Canto
The warbleR function [`query_xc()`](https://marce10.github.io/warbleR/reference/query_xc.html) queries for avian vocalization recordings in the open-access online repository [Xeno-Canto](https://xeno-canto.org). It can return recordings metadata or download the associated sound files.
Example on how to get recording's metadata (no downloading):
```{r, message=FALSE, warning=FALSE}
library(warbleR)
pl <- query_xc(qword = 'Parus major', download = FALSE)
```
Keep only song vocalizations:
```{r}
song_pl <- pl[grep("song", ignore.case = TRUE, pl$Vocalization_type), ]
```
Map locations using [`map_xc()`](https://marce10.github.io/warbleR/reference/map_xc.html):
```{r, results = 'asis', fig.width=10}
map_xc(song_pl, leaflet.map = TRUE)
```
Once you feel fine with the subset of data you can go ahead and download it as follows:
```{r, eval = FALSE, fig.width=10}
query_xc(X = song_pl, download = TRUE, path = "DIRECTORY WHERE YOU WANT TO SAVE THE FILES")
```
------------------------------------------------------------------------
<font size="4">Session information</font>
```{r session info, echo=F}
sessionInfo()
```