Learn R Programming

warbleR (version 1.1.2)

imp.syrinx: Import Syrinx selections

Description

imp.syrinx Imports Syrinx selection data from many files simultaneously. All files must be have the same columns.

Usage

imp.syrinx(path = 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).
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 the information from 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.file column. In addition, all rows with duplicated data are removed. This is useful when both spectrogram and waveform views are included in the Syrinx selection files. If all.data is set to TRUE) then all columns in selection files are returned. @seealso imp.raven

Examples

Run this code
## Not run: 
# # First set temporary folder
# setwd(tempdir())
# 
# #load data 
# data(selection.files)
# 
# write.table(selection.files[[3]],file = "harpyeagle.wav.txt",row.names = FALSE,
#  col.names = FALSE, sep= "\t")
# 
# write.table(selection.files[[4]],file = "Phae.long4.wav.txt",row.names = FALSE, 
# col.names = FALSE, sep= "\t")
# 
# syr.dat<-imp.syrinx(all.data = FALSE)
# 
# View(syr.dat)
# 
# #getting all the data
# syr.dat<-imp.syrinx(all.data = TRUE)
# 
# View(syr.dat)
# ## End(Not run)

Run the code above in your browser using DataLab