Sigma0: \bar{sigma}_i computing using raw accelerometry data

Description Usage Arguments Value Examples

View source: R/Sigma0.r

Description

Sigma0 computes \bar{σ}_i, which is needed for the Activity Index computing in computeActivityIndex

Usage

1
Sigma0(x, hertz = 30)

Arguments

x

A 4-column data frame containing the raw accelerometry data when the device is not worn. The 1st column has the record/index number. The 2nd to 4th columns contain the tri-axial raw acceleration. The data will be used to calculate \bar{σ}_i.

hertz

The sample rate of the data.

Value

\bar{σ}_i, a numeric vector of length one.

Examples

1
2
3
4
5
6
filename = system.file("extdata","sample_GT3X+.csv.gz",package="ActivityIndex")
res = ReadGT3XPlus(filename)
hertz = res$Hertz
x = res$Raw[ 1:1000, c("Time", "X", "Y", "Z")]
res = Sigma0(x, hertz = hertz)
testthat::expect_equal(res, c(SD = 0.184321637135534))

oslerinhealth/ActivityIndex documentation built on May 27, 2021, 2:40 a.m.