Learn R Programming

warbleR (version 1.1.4)

imp.raven: Import Raven selections

Description

imp.raven imports Raven selection data from many files simultaneously. Files must be in .txt format.

Usage

imp.raven(path = NULL, sound.file.col = NULL, all.data = FALSE, recursive = FALSE)

Arguments

path
A character string indicating the path of the directory in which to look for the text files. If not provided (default) the function searches into the current working directory. Default is NULL).
sound.file.col
A character string with the name of the column listing the sound files in the selection text files. Default is NULL).
all.data
Logical. If TRUE) all columns in text files are returned. Default is FALSE). Note that all files should contain exactly the same columns in the same order.
recursive
Logical. If TRUE) the listing recurse into sub-directories.

Value

A single data frame with information of the selection files. If all.data argument is set to FALSE) the data frame contains the following columns: selec, start, end, and selec.file. If sound.file.col is provided the data frame will also contain a 'sound.files' column. In addition, all rows with duplicated data are removed. This is useful when both spectrogram and waveform views are included in the Raven selection files. If all.data is set to TRUE then all columns in selection files are returned.

Details

The function import raven selection data from many files simultaneously. Files must be in .txt format. Note that selection files including data from mulitple recordings cannot be imported.

See Also

imp.syrinx

Examples

Run this code
## Not run: 
# # First set temporary folder
# setwd(tempdir())
# 
# data(selection.files)
# 
# write.table(selection.files[[1]],file = "100889-Garrulax monileger.selections.txt",
# row.names = FALSE, sep= "\t")
# 
# write.table(selection.files[[2]],file = "1023-Arremonops rufivirgatus.selections.txt",
# row.names = FALSE, sep= "\t")
# 
# #providing the name of the column with the sound file names
# rav.dat<-imp.raven(sound.file.col = "End.File", all.data = FALSE)
# 
# View(rav.dat)
# 
# #getting all the data
# rav.dat<-imp.raven(all.data = TRUE)
# View(rav.dat)
# ## End(Not run)

Run the code above in your browser using DataLab