Here we present a case study of how
warbleR functions can be used for bioacoustics, as well as some tips on managing bioacoustic data in R. For more details about function arguments, input or output, please read the documentation for the function in question (e.g.
Please note that most tools in
warbleR use functions from the
seewave package internally.
warbleR has been designed to make the analyses more accessible to average R-users. However, acoustic analysis in R would not be possible without the tools provided by
seewave. Hence, both packages should be given credit when using
warbleR and both should be appropriately cited in publications (try
This vignette can be run without an advanced understanding of R, as long as you know how to run code in you R console. However, knowing more about data and file manipulation would be very helpful in order to modify the code to fit your own needs.
First, we need to install and load
warbleR. Notice that you need an R version ≥ 2.10 and seewave package version ≥ 2.0.1. Also, users using UNIX machines (Mac OSX or Linux), will need to install
libsndfile on their machines prior to installing
warbleR. These external packages will need to be installed through a UNIX terminal.
And set up a working directory
# Create a new directory dir.create(file.path(getwd(),"warbleR_example")) setwd(file.path(getwd(),"warbleR_example")) # Check the location of the directory getwd()
Next, we can query the Xeno-Canto database for a species or genus of interest. The function
querxc has two types of output:
Metadata of recordings: geographic coordinates, recording quality, recorder, type of signal, etc.
Sound files: Sound files (mp3 format) are returned if the argument
download is set to
TRUE (default is
You can query Xeno-Canto by genus:
# Query Xeno-Canto for all recordings of the hummingbird genus Phaethornis Phae <- querxc(qword = "Phaethornis", download = FALSE)
## Obtaining recording list...
## 769 recordings found!
# Find out what kind of metadata we have names(Phae)
##  "Recording_ID" "Genus" "Specific_epithet" ##  "Subspecies" "English_name" "Recordist" ##  "Country" "Locality" "Latitude" ##  "Longitude" "Vocalization_type" "Audio_file" ##  "License" "Url" "Quality" ##  "Time" "Date"
Or you can query by species:
# Query Xeno-Canto for all recordings of the species Phaethornis longirostris Phae.lon <- querxc(qword = "Phaethornis longirostris", download = FALSE) View(Phae.lon)
If you’re interested in the geographic spread of the recording locations, you can use the function
xcmaps to visualize locations.
xcmaps will create an image file of a map per species in your current directory if
img = TRUE. If
img = FALSE, maps will be displayed in the graphic device.
# Image type default is jpeg, but tiff files have better resolution xcmaps(X = Phae, img = TRUE, it = "tiff") xcmaps(X = Phae.lon, img = FALSE)