---
title: Package overview
pagetitle: Package overview
author:
- Marcelo Araya-Salas, PhD & Grace Smith-Vidaurre
date: "`r Sys.Date()`"
output:
rmarkdown::html_document:
self_contained: yes
toc: true
toc_depth: 3
toc_float:
collapsed: false
smooth_scroll: true
vignette: >
%\usepackage[utf8]{inputenc}
%\VignetteIndexEntry{1. Introduction to warbleR}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
editor_options:
chunk_output_type: console
params:
EVAL: !r identical(Sys.getenv("NOT_CRAN"), "true")
---
```{css, echo = FALSE}
div#header h1.title, div#header h3.subtitle, div#header h4.author, div#header h4.date {
text-align: center
}
```
The [warbleR](https://cran.r-project.org/package=warbleR) package is intended to facilitate the analysis of the structure of the animal acoustic signals in R. Users can enter their own data into a workflow that facilitates spectrographic visualization and measurement of acoustic parameters **warbleR** makes use of the fundamental sound analysis tools of the **seewave** package, and offers new tools for acoustic structure analysis. These tools are available for batch analysis of acoustic signals.
The main features of the package are:
- The use of loops to apply tasks through acoustic signals referenced in a selection table
- The production of image files with spectrograms that let users organize data and verify acoustic analyzes

We can group **warbleR** functions according to the bioacoustic analysis stages.
### Get and prepare recordings
The `query_xc()` function allows you to search and download sounds from the free access database [Xeno-Canto](https://www.xeno-canto.org/). You can also convert .mp3 files to .wav, change the sampling rate of the files and correct corrupt files, among other functions.
```{r, echo = FALSE, eval = TRUE}
library(kableExtra)
names(cf) <- gsub("\\.", " ", names(cf))
cf2 <- cf[cf$`Obtener preparar grabaciones` == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
### Annotating sound
It is recommended to make annotations in other programs and then import them into R (for example in Raven and import them with the **Rraven** package). However, **warbleR** offers some functions to facilitate manual or automatic annotation of sound files, as well as the subsequent manipulation:
```{r, echo = FALSE, eval = TRUE}
cf2 <- cf[cf$Anotar == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
### Organize annotations
The annotations (or selection tables) can be manipulated and refined with a variety of functions. Selection tables can also be converted into the compact format *extended selection tables*:
```{r, echo = FALSE, eval = TRUE}
cf2 <- cf[cf$`Organizar anotaciones` == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
### Measure acoustic signal structure
Most **warbleR** functions are dedicated to quantifying the structure of acoustic signals listed in selection tables using batch processing. For this, 4 main measurement methods are offered:
1. Spectrographic parameters
1. Cross correlation
1. Dynamic time warping (DTW)
1. Statistical descriptors of cepstral coefficients
Most functions gravitate around these methods, or variations of these methods:
```{r, echo = FALSE, eval = TRUE}
cf2 <- cf[cf$`Medir estructura` == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
### Verify annotations
Functions are provided to detect inconsistencies in the selection tables or modify selection tables. The package also offers several functions to generate spectrograms showing the annotations, which can be organized by annotation categories. This allows you to verify if the annotations match the previously defined categories, which is particularly useful if the annotations were automatically generated.
```{r, echo = FALSE, eval = TRUE}
cf2 <- cf[cf$Verificar == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
### Visual inspection of annotations and measurements
```{r, echo = FALSE, eval = TRUE}
cf2 <- cf[cf$`Inspeccion visual` == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
### Additional functions
Finally, **warbleR** offers functions to simplify the use of extended selection tables, organize large numbers of images with spectrograms and generate elaborated signal visualizations:
```{r, echo = FALSE, eval = TRUE}
cf2 <- cf[cf$`Analisis estadistico` == "x" | cf$Otros == "x", c("Function", "Description", "Works on", "Output")]
cf2$Function <- cell_spec(x = cf2$Function, link = paste0("https://marce10.github.io/warbleR/reference/", cf2$Function, ".html"))
kbl <- kable(cf2, align = "c", row.names = F, format = "html", escape = F)
kbl <- column_spec(kbl, 1, bold = TRUE)
kbl <- column_spec(kbl, 2:4, italic = TRUE)
kbl <- kable_styling(kbl, bootstrap_options = "striped", font_size = 14)
kbl
```
---
## References
1. Araya-Salas M, G Smith-Vidaurre & M Webster. 2017. Assessing the effect of sound file compression and background noise on measures of acoustic signal structure. Bioacoustics 4622, 1-17
1. Araya-Salas M, Smith-Vidaurre G (2017) warbleR: An R package to streamline analysis of animal acoustic signals. Methods Ecol Evol 8:184-191.
---
Session information
```{r session info, echo=F}
sessionInfo()
```