binDetectionData {PAMscapes} | R Documentation |
Bin Detection Data to Time Bins
Description
Transforms detection data to presence-type data with user specified time bin (e.g. hourly or daily presence).
Usage
binDetectionData(
x,
bin,
columns = c("species"),
rematchGPS = TRUE,
gpsGroup = NULL
)
Arguments
x |
dataframe of detection data |
bin |
the amount time to bin by, must be a character of the form
|
columns |
names of the columns in |
rematchGPS |
logical flag, if |
gpsGroup |
the name of the column in |
Value
a dataframe where each row represents detection presence of one time unit
Author(s)
Taiki Sakai taiki.sakai@noaa.gov
Examples
dets <- data.frame(
UTC = as.POSIXct(c('2020-04-04 12:20:00', '2020-04-04 12:40:00', '2020-04-04 13:20:00')),
species = c('whale', 'whale', 'dolphin'),
call = c('a', 'b', 'c'))
# two rows of outputs
binDetectionData(dets, bin='1hour', columns='species')
# adding "call" creates 3 rows of outputs
binDetectionData(dets, bin='1hour', columns=c('species', 'call'))