exp_raven | R Documentation |
exp_raven
exports selection tables as 'Raven' selection data in .txt format.
exp_raven(X, path = NULL, file.name = NULL, khz.to.hz = TRUE,
sound.file.path = NULL, single.file = TRUE, parallel = 1, pb = TRUE)
X |
Object of class data frame or |
path |
A character string indicating the path of the directory in which to save the selection files. If not provided (default) the function saves the file into the current working directory. |
file.name |
Name of the output .txt file. If |
khz.to.hz |
Logical. Controls if frequency variables should be converted from kHz (the unit used by other bioacoustic analysis R packages like warbleR) to Hz (the unit used by Raven). Default is |
sound.file.path |
A character string indicating the path of the
directory containing the sound file(s). Providing this information allows
to open both sound file and selection table simultaneously. This can be
done by using the 'File > Open selection table' option in 'Raven' (or drag/drop the
selection file into Raven). Default is |
single.file |
Logical. Controls whether a single selection file ( |
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). |
pb |
Logical argument to control progress bar. Default is |
The function exports selection tables (as the ones used in the R package warbleR) into the 'Raven' selection file format ('.txt'). This can be useful to obtain additional Raven measurements on existing selections by adding new measurements to the selection table once in Raven. Note that selection labels must be numeric and non-duplicated when exporting them to Raven. If that is not the case the function will relabeled the selections and the previous selection labels will be retained in a new column ('old.selec').
The function saves a selection table in '.txt' format that can be directly opened in Raven. If several sound files are available users can either export them as a single selection file or as multiple selection files (one for each sound file). No objects are returned in the R environment.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
imp_raven
; imp_syrinx
# Load data
library(warbleR)
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "lbh_selec_table"))
# Select data for a single sound file
st1 <- lbh_selec_table[lbh_selec_table$sound.files == "Phae.long1.wav", ]
# Export data of a single sound file
exp_raven(st1, file.name = "Phaethornis 1", path = tempdir())
# Export a single selection table including multiple files
tuneR::writeWave(Phae.long1, file.path(tempdir(),
"Phae.long1.wav"), extensible = FALSE) #save sound files
tuneR::writeWave(Phae.long2, file.path(tempdir(),
"Phae.long2.wav"), extensible = FALSE)
tuneR::writeWave(Phae.long3, file.path(tempdir(),
"Phae.long3.wav"), extensible = FALSE)
tuneR::writeWave(Phae.long4, file.path(tempdir(),
"Phae.long4.wav"), extensible = FALSE)
# export raven selection as single file
exp_raven(X = lbh_selec_table, file.name = "Phaethornis multiple sound files",
single.file = TRUE, sound.file.path = tempdir(), path = tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.