View source: R/merge_overlaps.R
merge_overlaps | R Documentation |
merge_overlaps
merges several overlapping selections into a single selection
merge_overlaps(X, pb = TRUE, cores = 1)
X |
Data frame or 'selection.table' (following the warbleR package format) with selections (start and end of the sound events). Must contained at least the following columns: "sound.files", "selec", "start" and "end". |
pb |
Logical argument to control progress bar. Default is |
cores |
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing). |
The function finds time-overlapping selection in reference tables and collapses them into a single selection. It can be useful to prepare reference tables to be used in an energy detection routine. In such cases overlapping selections are expected to be detected as a single sound. Therefore, merging them can be useful to prepare references in a format representing a more realistic expectation of how a perfect energy detection routine would look like.
If any time-overlapping selection is found it returns a data frame in which overlapping selections are collapse into a single selection.
Marcelo Araya-Salas marcelo.araya@ucr.ac.cr)
Araya-Salas, M., Smith-Vidaurre, G., Chaverri, G., Brenes, J. C., Chirino, F., Elizondo-Calvo, J., & Rico-Guevara, A. 2022. ohun: an R package for diagnosing and optimizing automatic sound event detection. BioRxiv, 2022.12.13.520253. https://doi.org/10.1101/2022.12.13.520253
summarize_diagnostic
, label_detection
{
# load data
data("lbh_reference")
# nothing to merge
merge_overlaps(lbh_reference)
# create artificial overlapping selections
lbh_ref2 <- rbind(as.data.frame(lbh_reference[c(3, 10), ]), lbh_reference[c(3, 10), ])
lbh_ref2$selec <- seq_len(nrow(lbh_ref2))
merge_overlaps(lbh_ref2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.