Skip to contents

This function reads an .agd file and then creates the vector magnitude variable as follows: \(vm = \sqrt{axis1^{2} + axis2^{2} + axis3^{2}}\). The .agd file must contain at least the following columns:

  • axis1

  • axis2

  • axis3

  • steps

Usage

prepare_dataset(data)

Arguments

data

Path to an .agd file that was exported from ActiLife software.

Value

A dataframe.

Examples

file <- system.file("extdata", "acc.agd", package = "activAnalyzer")
mydata <- prepare_dataset(data = file)
head(mydata)
#>             TimeStamp axis1 axis2 axis3 steps lux inclineoff inclinestanding
#> 1 2021-04-07 06:00:00     0     0     0     0   0         10               0
#> 2 2021-04-07 06:00:10     0     0     0     0   0         10               0
#> 3 2021-04-07 06:00:20     0     0     0     0   0         10               0
#> 4 2021-04-07 06:00:30     0     0     0     0   0         10               0
#> 5 2021-04-07 06:00:40     0     0     0     0   0         10               0
#> 6 2021-04-07 06:00:50     0     0     0     0   0         10               0
#>   inclinesitting inclinelying vm
#> 1              0            0  0
#> 2              0            0  0
#> 3              0            0  0
#> 4              0            0  0
#> 5              0            0  0
#> 6              0            0  0