batchDetection {monitoR}R Documentation

Batch Template Detection

Description

These functions are used to carry out template dection for multiple template and survey files in a single call. These functions make it easy to analyze multiple survey files in a single call. They call corMatch or binMatch, followed by findPeaks and getDetections to do the work.

Usage

batchCorMatch(dir.template, dir.survey = ".", ext.template = "ct", ext.survey = "wav", 
    templates, parallel = FALSE, show.prog = FALSE, cor.method = "pearson", warn = TRUE, 
    time.source = "filename", fd.rat = 1, ...)

batchBinMatch(dir.template, dir.survey = ".", ext.template = "bt", ext.survey = "wav", 
    templates, parallel = FALSE, show.prog = FALSE, warn = TRUE, 
    time.source = "filename", fd.rat = 1, ...)

Arguments

dir.template

A file path to a directory that contains template files to be used. Only used if template is missing.

dir.survey

A file path to a directory that contains survey files to be analyzed.

ext.template

Extension of the template files.

ext.survey

Extension of the survey files.

templates

A template list–a corTemplateList object for corMatch or a binTemplateList object for binMatch. If templates is missing, all the template files in dir.template will be used instead.

parallel

If TRUE, mclapply from the parallel package is used for calculation of scores across all time bins for each template. This option is not available for Windows operating systems.

show.prog

If TRUE, progress will be reported during the score calculations.

cor.method

For corMatch, the method used to calculate correlation coefficients (see cor).

warn

Set to FALSE to suppress warnings about step mismatches.

time.source

The source of date and time information. filename will look in the name of the survey file (survey argument) for a date and time with format YYYY-MM-DD_HHMMSS_TimeZone. fileinfo will take the date and time from the file modification information.

fd.rat

A ratio of frame width (twice minimum peak separation) to template duration. Used by findPeaks.

...

Additional arguments to the spectro function.

Details

These functions are simple but do not provide flexibility in how results are handled. Manually writing a for loop is a more flexible solution.

Value

A data frame of detections, as returned by getDetections.

Author(s)

Sasha D. Hafner

See Also

corMatch, binMatch, findPeaks, getDetections

Examples

## Not run: 
# Assume multiple survey files are in the subdirectory "Surveys" and templates 
# are in subdirectory "Templates"
detects <- batchCorMatch("Templates", "Surveys")

# Or, to use an existing template list instead
detects <- batchCorMatch(templates = ctemps, dir.survey = "Surveys")

## End(Not run)


[Package monitoR version 1.0.7 Index]