label.data: Label measurement data

Description Usage Arguments Details Value Author(s)

Description

This function labels measurement data according to behavioral observations. The format of behavioral observations follows CowLog convention (See details).

Usage

1
label.data(data, observation, db = 5, de = 5, min.length = 20)

Arguments

data

A data.frame holding the measurement data, one of the elements needs to be named time and hold the time stamp for each row.

observation

A data.frame with behavioral observations, one of the elements needs to be named time and hold the time stamps for the behaviors and another named behavior and hold the labels for respective behaviors. See details.

db

Specifies the delay in seconds from the observation to the start of labeling, this is sometimes useful if the data is used for model building and we want to eliminate the temporal inaccury due to behavioral observations. Defaults to 5

de

Similarly to db, specifies the (negative) delay in seconds from the end of observation. Defaults to 5

min.length

descibes the minimum length of the labeled data vector. Again sometimes we want to have long enough data vectors for model building and leave out too short bits. This is the length after substracting db and de. Defaults to 20

Details

The time stamp in behavior and data need to be in the same format i.e. POSIXt or seconds from the start in numeric format. The POSIXt is naturally more convinient since then the behavioral observation and the measurement need not to begin from the same time point. The data.frame observation need to have at least two elements: time and behavior (any additional elements are ignored). The time specifies the start of the corresponding behavior and the start time of the next behavior is used as the end of the previous one. The format is adopted from CowLog behavioral coding software (http://www.mm.helsinki.fi/~mpastell/CowLog).

Value

The original data with two additional elements: label which contains the labels for each row in the data and freq which tells the number of the label counting from the beginning.

Author(s)

Matti Pastell <matti.pastell@helsinki.fi>


Animal documentation built on May 2, 2019, 5:48 p.m.