cows_5hz {triact}R Documentation

cow acceleration data

Description

Acceleration data collected with triaxial accelerometers (MSR145, MSR Electronics, Switzerland) attached to the left hind leg of two dairy cows (cow01, cow02). The accelerometer sampling frequency was 5 Hz. The forward, up, and right acceleration correspond to body relative directions as used in triact (see vignette("introduction", package = "triact") and Simmler & Brouwers, 2023).

colname type description
id Factor unique id for the cow
time POSIXct timestamp
acc_fwd numeric acceleration from forward axis (units: g)
acc_up numeric acceleration from up axis (units: g)
acc_right numeric acceleration from right axis (units: g)

Usage

cows_5hz

Note

From the raw data files distributed with the triact package, cows_5hz can be reproduced as follows:

# create a Triact object
my_triact <- Triact$new()

input_dir <- system.file("extdata", package = "triact")

# load data from files
# note the mapping of XYZ to forward, up, right (parameter timeFwdUpRight_cols)

my_triact$load_files(input = input_dir,
                     id_substring = c(1, 5),
                     timeFwdUpRight_cols = c(1, -2, 3, -4),
                     tz = "Europe/Zurich",
                     skip = "DATA")

cows_5hz_recreated <- my_triact$data

# test whether they are identical
identical(cows_5hz_recreated, cows_5hz)

Source

Agroscope, 8356 Ettenhausen, Switzerland

References

Simmler. M., Brouwers S. P., 2023. Triact package for R: Analyzing the lying behavior of cows from accelerometer data. pdf


[Package triact version 0.3.0 Index]