Export a 'Raven' selection for all sound files in a folder
Source:R/exp_empty_sels.R
exp_empty_sels.Rd
exp_empty_sels
exports a 'Raven' selection data in .txt format that includes empty selections for all sound files in a folder.
Arguments
- path
A character string indicating the path of the directory in which to look for sound files. If not provided (default) the function will use the current working directory.
- file.name
Name of the output .txt file. If
NULL
then the folder name is used instead.- sound.files
character vector indicating the sound files that will be included. If
NULL
(default) then all sound files in the working directory (or 'path') will be included.- pb
Logical argument to control progress bar. Default is
TRUE
.
Value
The function saves a selection table in '.txt' format that can be directly opened in Raven. No objects are returned in the R environment.
Details
The function saves a selection file in '.txt' format (that can be directly opened in Raven) that will display all sound files in the provided directory (argument 'path'). Useful to simplify the making of selections from several sound files that need to be displayed simultaneously (e.g. several recordings from the same individual). The selection file is saved in the provided directory ('path').
Author
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Examples
# Load data
library(NatureSounds)
#> Loading required package: knitr
library(warbleR)
#> Loading required package: tuneR
#> Loading required package: seewave
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "lbh_selec_table"))
## Export a single selection table including multiple files
#save sound files
tuneR::writeWave(Phae.long1, file.path(tempdir(),
"Phae.long1.wav"), extensible = FALSE)
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 with no file name
exp_empty_sels(path = tempdir())
#> all selections are OK
#>
#> exporting annotations (step 0 of 0):
# export with file name
exp_empty_sels(file.name = "Phaethornis.longirostris", path = tempdir())
#> all selections are OK
#>