regularize_activity: Regularize activity data

View source: R/regularize_activity.R

regularize_activityR Documentation

Regularize activity data

Description

regularize_activity regularizes the timestamps within the $acticity_data of an activity object (column 'ts') to regular intervals for each animal_tag. The interval is defined by the parameter minutes. The following steps are performed:

Usage

regularize_activity(activity, act.reg_minutes = NULL)

Arguments

activity

An object of class activity.

act.reg_minutes

The regular interval in minutes.

Details

  1. Round each timestamp to the nearsed regular timestamp.

  2. When several data points occur with the same regularized timestamp, aggregate these by calculating the mean of the activity values.

  3. Insert data points for missing regularized timestamps with NA-activity values .

Value

The original activity object with regularized timestamps for its $acticity_data in column 'ts'.

Examples

activity_data <- regularize_activity(data = activity_data, minutes = 5)

maxkroeschel/activitytools documentation built on July 31, 2023, 1:34 p.m.