I have wildlife camera trap data. Often one animal will trigger a camera repeatedly if it remains in it's frame for a long period of time. I would like to identify when this occurs.
If there are consecutive events (rows) with less than 5 minutes between (within a date), I assume it is one animal. I would like to choose one row and discard the rest. I would also like to group by site. Here is an example of my data and the desired outcome.
Current data:
tibble::tribble(
~date, ~time, ~site,
"24/08/2019", "14:44", "A",
"24/08/2019", "14:45", "A",
"24/08/2019", "14:46", "A",
"24/08/2019", "14:50", "A",
"24/08/2019", "14:47", "B",
"24/08/2019", "14:48", "B",
"24/08/2019", "17:14", "B",
"24/08/2019", "17:18", "B",
"24/08/2019", "20:04", "B",
"25/08/2019", "14:42", "A"
)
date time site
24/08/2019 14:44 A
24/08/2019 14:45 A
24/08/2019 14:46 A
24/08/2019 14:50 A
24/08/2019 14:47 B
24/08/2019 14:48 B
24/08/2019 17:14 B
24/08/2019 17:18 B
24/08/2019 20:04 B
25/08/2019 14:42 A
Desired outcome:
date time site
24/08/2019 14:44 A
24/08/2019 14:47 B
24/08/2019 17:14 B
24/08/2019 20:04 B
25/08/2019 14:42 A
Thank you in advance!