01-data-gathering.Rmd
Steps: - 1) create a vector of all species of interest. - 2) decide if want to download mp3 or not. - 3) set directory for mp3 storage.
# list here all the species.
bird_species <- c("megascops choliba",
"strix hylophila",
"pulsatrix koeniswaldiana",
"megascops atricapilla",
"glaucidium minutissimum")
# Should the MP3 be downloaded to the hard disk?
download <- TRUE
# insert here which folder do you want to store the mp3 files.
dir <- "dados/mp3_originals"
if(!fs::dir_exists(dir)) fs::dir_create(dir)
The warbleR::querxc()
function retrieve mp3 files from xeno-canto.org repository.
The package {wikiaves} is not on CRAN yet. Github install only.
# install.packages("remotes")
# remotes::install_github("Athospd/wikiaves")
library(wikiaves)
# set donwload = TRUE for download the files to your hard disk.
metadata_wa <- bird_species %>%
wa_metadata(download = download, path = dir) %>%
tidyr::nest(mp3_wa = c(-term))