imp_raven | R Documentation |
imp_raven
imports several 'Raven' selection files simultaneously. Files must be in '.txt' format.
imp_raven(path = NULL, warbler.format = FALSE, all.data = FALSE, files = NULL,
only.spectro.view = TRUE, recursive = FALSE, name.from.file = FALSE,
ext.case = NULL, freq.cols = TRUE, waveform = FALSE, parallel = 1, pb = TRUE,
unread = FALSE, rm.dup = FALSE, sound.file.col = NULL)
path |
A character string indicating the path of the directory in which to look for the 'Raven' selection (text) files. If not provided (default) the function searches into the current working directory. |
warbler.format |
Logical. If |
all.data |
Logical. If |
files |
Character vector indicating the name of selection files (in .txt format) to be imported. Optional. Default is |
only.spectro.view |
Logical. If |
recursive |
Logical. If |
name.from.file |
Logical. If |
ext.case |
Character string of length 1 to specify whether sound file extensions are in upper or lower case. This should match the extension of the
of the .wav files from which the selection were made. It must be either 'upper' or 'lower'. Only needed when 'name.from.file' is |
freq.cols |
Logical. If |
waveform |
Logical to control if waveform view data should be included (this data is typically duplicated in spectrogram view data). Default is |
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 |
unread |
DEPRECATED. Logical. If |
rm.dup |
Logical. If |
sound.file.col |
A character string with the name of the column containing the sound files in
the selection text files. Default is |
The function import 'Raven' selection data from many files simultaneously. All selection files in the working directory or 'path' supplied will be imported (unless 'files' argument is also supplied). It has been created using Raven Pro 1.5 and tested on Raven 1.6. Selection tables created with other versions might not be read properly. Files must be in '.txt' format. Selection files including data from multiple recordings can also be imported although they must contained a 'File Offset (s)' column. Selections that span across multiple sound files are not recommended as they will be assigned to the first sound file, which would produce errors for downstream analyses as those from the 'warbleR' package. Empty '.txt' files are ignored.
A single data frame with information of the selection files. If some selection files were not read they will be listed in .Options$Rraven
.
If 'warbler.format' argument is set to TRUE
the data frame contains the following columns: sound.files, selec, channel,start, end, top.freq, bottom.freq and selec.file. If all.data is set to TRUE
then all columns in the 'Raven' selection files are returned.
If individual selection files contain information about multiple sound files the function will import the file and correct the time
parameters (start and end) only if 1) the 'File Offset (s)' is found in the selection table.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
imp_syrinx
# load data
data(selection_files)
# save 'Raven' selection tables in the temporary directory
out <- lapply(1:2, function(x)
writeLines(selection_files[[x]], con = file.path(tempdir(), names(selection_files)[x])))
# providing the name of the column with the sound file names
rvn.dat <- imp_raven(sound.file.col = "Begin.File", all.data = FALSE, path = tempdir())
# View(rvn.dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.