View source: R/sampleDetector.R
sampleDetector | R Documentation |
samples either a fraction or fixed number from each detector in each event of an AcousticStudy
sampleDetector(x, n = 1)
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. |
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
subsampled AcousticStudy x
Taiki Sakai taiki.sakai@noaa.gov
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.