calc_active_periods: Calculate active periods for camera trap data

View source: R/ct_plot_camtrap_activity.R

calc_active_periodsR Documentation

Calculate active periods for camera trap data

Description

Internal helper function to calculate continuous active periods based on gap detection.

Usage

calc_active_periods(data, threshold, time_unit)

Arguments

data

A data frame containing the datetime column.

threshold

A numeric value indicating the minimum gap to be considered a break (default is 10).

time_unit

The unit for the threshold. Supported values include "secs", "mins", "hours", "days", and "weeks".

Value

A tibble with period_start and period_end columns.


ct documentation built on Oct. 22, 2026, 1:07 a.m.