Description Usage Arguments Details Value Examples
View source: R/computeActivityIndex.r
computeActivityIndex
computes the Activity Index using raw
accelerometry data, based on user specified parameters such as sample rate
and epoch length.
1 2 3 4 5 6 7 | computeActivityIndex(x, x_sigma0 = NULL, sigma0 = NULL, epoch = 1, hertz)
## Default S3 method:
computeActivityIndex(x, x_sigma0 = NULL, sigma0 = NULL, epoch = 1, hertz)
## S3 method for class 'GT3XPlus'
computeActivityIndex(x, x_sigma0 = NULL, sigma0 = NULL, epoch = 1, hertz)
|
x |
An object containing raw accelerometry data, which could
either be a 4-column data frame or " |
x_sigma0 |
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. |
sigma0 |
Specify \bar{σ}_i directly. At least one of
|
epoch |
The epoch length (in second) of the Activity Index. Must be a positive integer. |
hertz |
The sample rate of the data. |
x
could be either of the following two types of objects:
A 4-column data frame containing the tri-axial raw accelerometry
data in the 2nd to 4th column, and the associated record number (could be
time) in the 1st column. ReadTable
can be used to generate
such data frame.
An "GT3XPlus
" object given by function
ReadGT3XPlus
.
A data frame with two columns. The first column has the "record number" associated with each entry of Activity Index, while the second column has the actual value of Activity Index.
1 2 3 4 5 6 7 8 9 10 11 | library(graphics)
fname = system.file("extdata", "sample_table.csv.gz",
package = "ActivityIndex")
sampleTable = ReadTable(fname)
AI_sampleTable_x = computeActivityIndex(
sampleTable,
x_sigma0 = sampleTable[1004700:1005600, ],
epoch = 1,
hertz = 30)
AI_sampleTable_x
plot(AI ~ RecordNo, data = AI_sampleTable_x, type = "l")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.