View source: R/overlapping_sels.R
overlapping_sels | R Documentation |
overlapping_sels
finds which selections overlap in time within a given sound file.
overlapping_sels(
X,
index = FALSE,
pb = TRUE,
max.ovlp = 0,
relabel = FALSE,
drop = FALSE,
priority = NULL,
priority.col = NULL,
indx.row = FALSE,
parallel = 1,
verbose = TRUE
)
X |
'selection_table' object or data frame with the following columns: 1) "sound.files": name of the sound files, 2) "selec": number of the selections, 3) "start": start time of selections, 4) "end": end time of selections. |
index |
Logical. Indicates if only the index of the overlapping selections would be returned.
Default is |
pb |
Logical argument to control progress bar and messages. Default is |
max.ovlp |
Numeric vector of length 1 specifying the maximum overlap allowed (in seconds) . Default is 0. |
relabel |
Logical. If |
drop |
Logical. If |
priority |
Character vector. Controls the priority criteria used for removing overlapped selections. It
must list the levels of the column used to determine priority (argument priority.col) in the desired
priority order. Default is |
priority.col |
Character vector of length 1 with the name of the column use to determine the priority of
overlapped selections. Default is |
indx.row |
Logical. If |
parallel |
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing). |
verbose |
Logical to control if messages are printed to the console. |
This function detects selections within a selection table that overlap in time. Selections must be
listed in a data frame similar to lbh_selec_table
. Note that row names are set to 1:nrow(X)
.
A data frame with the columns in X plus an additional column ('ovlp.sels') indicating
which selections overlap. For instance, if the selections in rows 1,2
overlap and 2 and 3 also overlap, the 'ovlp.sels' label would be the same for all 3 selections. If
drop = TRUE
only the non-overlapping selections are returned.and if 2 or more selections
overlap only the first one is kept. The arguments 'priority' and 'priority.col' can be used to modified the criterium for droping overlapping selections.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: An R package to streamline analysis of animal acoustic signals. Methods in Ecology and Evolution, 8(2), 184-191.
filter_sels
, lbh_selec_table
{
# no overlap
overlapping_sels(X = lbh_selec_table)
# modified lbh_selec_table to make the first and second selection overlap
Y <- lbh_selec_table
Y$end[4] <- 1.5
overlapping_sels(X = Y)
# drop overlapping
overlapping_sels(X = Y, drop = TRUE)
# get index instead
overlapping_sels(X = Y, index = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.