bindEvents: Summarize/Archive Manually Derived Sound Events

View source: R/bindEvents.R

bindEventsR Documentation

Summarize/Archive Manually Derived Sound Events

Description

Read in a table of song event times and the corresponding Wave object, extract the song events, and bind them into a single Wave object for archiving or comparison viewing.

Usage

bindEvents(rec, file, by.species = TRUE, parallel = FALSE, return.times = FALSE)

Arguments

rec

File path to mp3 or wav file or object of class Wave

file

File path to csv file containing event times. See details.

by.species

Logical. Should each species be in its own Wave object?

parallel

Logical. FALSE will use lapply, TRUE will use mclapply.

return.times

Logical. FALSE returns only the Wave object with events. TRUE will also return a data frame with the start and end times of each event in the new Wave object linked to their original start and end times.

Details

The csv file supplied must use a standard set of column names, which can occur in any order:

  • name Species name

  • start.time Event start time, in seconds

  • end.time Event end time, in seconds

These column names are those supplied in an annotation file produced by viewSpec.

Value

If return.times = FALSE, an object of class Wave.
If return.times = TRUE, a list:

times

A data frame with the start and end times of events in the Wave object

wave

An object of class Wave

Author(s)

Sasha D. Hafner

See Also

viewSpec, collapseClips, bind.

Examples

 

data(survey_anno) 
data(survey)

# Don't return times
events <- bindEvents( rec = survey, file = survey_anno, by.species = TRUE, parallel = FALSE,
                     return.times = FALSE)

# Return times       
events <- bindEvents( rec = survey, file = survey_anno, by.species = TRUE, parallel = FALSE,
                     return.times = TRUE)
        

jonkatz2/monitoR documentation built on March 27, 2024, 4:39 p.m.