sampleDetector: Subsample Detectors in AcousticStudy

View source: R/sampleDetector.R

sampleDetectorR Documentation

Subsample Detectors in AcousticStudy

Description

samples either a fraction or fixed number from each detector in each event of an AcousticStudy

Usage

sampleDetector(x, n = 1)

Arguments

x

AcousticStudy object

n

if less than 1, proportion of rows to sample from each detector. If 1 or more, the number of rows to sample from each detector.

Details

Uses slice_sample to do the sampling, n is converted either to prop or n based on its size. Negative values are treated the same as in slice_sample

Value

subsampled AcousticStudy x

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples


data(exStudy)
nDetections(exStudy)
halfData <- sampleDetector(exStudy, n=0.5)
# there are odd numbers of rows in some detectors, so less than half
nDetections(exStudy)
oneDetPerDetector <- sampleDetector(exStudy, n=1)
nDetections(exStudy)


PAMpal documentation built on Aug. 12, 2023, 1:06 a.m.