regularize_activity: Regularize activity data

Description Usage Arguments Value Examples

View source: R/regularize_activity.R

Description

regularize activity regularizes the timestamps in column 'ts' to regular intervals for each animal_tag. The interval is defined by the parameter minutes. The following steps are performd:

  1. Round each timestamp to the nearsed regular timestamp.

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

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

Usage

1

Arguments

activity

A data.table with the activity data. The following columns should be present: 'animal_tag', 'ts', 'act_x' and 'act_y'.

minutes

The regular interval in minutes.

Value

The original data.table with regularized timestamps in column 'ts'.

Examples

1

maxkroeschel/activitytools documentation built on Jan. 15, 2019, 5:32 a.m.