View source: R/subsampleDetections.R
subsampleDetections | R Documentation |
Extract a random subsample of detections for each event and detector.
subsampleDetections(data, n)
data |
a detector data.frame or list of detector data.frames. |
n |
a value giving the number ( |
a detector data.frame or list of detector data.frames with
no more than n
detections per event per detector.
Eric Archer eric.archer@noaa.gov
Rankin, S., Archer, F., Keating, J. L., Oswald, J. N., Oswald, M. , Curtis, A. and Barlow, J. (2017), Acoustic classification of dolphins in the California Current using whistles, echolocation clicks, and burst pulses. Marine Mammal Science 33:520-540. doi:10.1111/mms.12381
data(train.data) # initial number of detections per event per detector sapply(train.data$detectors, function(x) table(x$event.id)) # select half of all detectors detect.half <- subsampleDetections(train.data$detectors, 0.5) sapply(detect.half, function(x) table(x$event.id)) # select 20 detections detect.20 <- subsampleDetections(train.data$detectors, 20) sapply(detect.20, function(x) table(x$event.id)) # select 10 detections fro 'ec' detector ec.10 <- subsampleDetections(train.data$detectors$ec, 10) table(ec.10$event.id)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.