| Title: | Generate ActiLife Counts |
|---|---|
| Description: | ActiLife software generates activity counts from data collected by Actigraph accelerometers <https://s3.amazonaws.com/actigraphcorp.com/wp-content/uploads/2017/11/26205758/ActiGraph-White-Paper_What-is-a-Count_.pdf>. Actigraph is one of the most common research-grade accelerometers. There is considerable research validating and developing algorithms for human activity using ActiLife counts. Unfortunately, ActiLife counts are proprietary and difficult to implement if researchers use different accelerometer brands. The code creates ActiLife counts from raw acceleration data for different accelerometer brands and it is developed based on the study done by Brond and others (2017) <doi:10.1249/MSS.0000000000001344>. |
| Authors: | Ruben Brondeel [aut], Javad Rahimipour Anaraki [aut], Daniel Fuller [aut, cph, cre], SeyedJavad KhataeiPour [aut], Beap Lab [cph] |
| Maintainer: | Daniel Fuller <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.1 |
| Built: | 2026-05-21 07:16:04 UTC |
| Source: | https://github.com/walkabillylab/activitycounts |
Calculates ActiLife counts based on raw accelerometer data
counts( data, hertz = -1, x_axis = 2, y_axis = 3, z_axis = 4, time_column = -1, start_time = -1 )counts( data, hertz = -1, x_axis = 2, y_axis = 3, z_axis = 4, time_column = -1, start_time = -1 )
data |
Accelerometer data, Must have at least three columns. |
hertz |
Sampling frequency in Hz |
x_axis |
Indicates the column number which has the accel data for x direction, the default is 2 |
y_axis |
Indicates the column number which has the accel data for y direction, the default is 3 |
z_axis |
Indicates the column number which has the accel data for z direction, the default is 4 |
time_column |
Optional. Indicates the column number which has the date and time. The first row will be considered as the start time of the study. You can use the "start_time" argument to provide the start time explicitly. |
start_time |
Optional. Use this to define the start time of the experiment. You can use this argument if the data does not contain a time column. |
Returns a data.table with four columns:
The start time of the measurement
the number of counts for X axis
the number of counts for Y axis
the number of counts for Z axis
sampleXYZ
raw accelerometer data for testing counts() function.
sampleCounts
counts calculated by activityCounts and ActiLife
# for tha sampleXYZ dataset, sampling frequency is 100 Hz counts(data = sampleXYZ, hertz = 100) # when start time is given explicitly study_start_time <- "2017-08-22 12:30:10" counts(data = sampleXYZ, hertz = 100 , start_time = study_start_time) # the data has a time column, which is the first column counts(data = sampleXYZ, hertz = 100 , time_column = 1) # explicitly specify the X, Y and Z axis columns. counts(data = sampleXYZ, hertz = 100 , x_axis = 2,y_axis = 3, z_axis = 4)# for tha sampleXYZ dataset, sampling frequency is 100 Hz counts(data = sampleXYZ, hertz = 100) # when start time is given explicitly study_start_time <- "2017-08-22 12:30:10" counts(data = sampleXYZ, hertz = 100 , start_time = study_start_time) # the data has a time column, which is the first column counts(data = sampleXYZ, hertz = 100 , time_column = 1) # explicitly specify the X, Y and Z axis columns. counts(data = sampleXYZ, hertz = 100 , x_axis = 2,y_axis = 3, z_axis = 4)
pptrunc
pptrunc(data, max_value)pptrunc(data, max_value)
data |
The variable that will be truncated |
max_value |
The upper bound ( -max_value is the lower bound) |
the highest(or the lowest) value of "data" and "max_value"
runsum
runsum(data, len, threshold)runsum(data, len, threshold)
data |
input data |
len |
the length |
threshold |
the threshold |
returns a
A simple data.table which its first row is measurement time. Then for each time step,
counts are calculated by activityCounts and the ActiLife software. The counts are calculated based on
included sampleXYZ dataset, which its sampling frequency is 100H.
sampleCountssampleCounts
A data.table with nine columns:
Date and time
counts calculated by counts() function in X direction
counts calculated by counts() function in Y direction
counts calculated by counts() function in Z direction
counts calculated by ActiLife software in X direction
counts calculated by ActiLife software in Y direction
counts calculated by ActiLife software in Z direction
counts to see how to produce counts.
sampleXYZ
raw accelerometer data for testing counts() function.
A simple data.table that contains raw accelerometer data for testing the
counts function. Sampling frequency of this data.table is 100Hz, therefore pass
100 as the second argument when using the counts function.
sampleXYZsampleXYZ
A data.table with four columns:
Timestamp
accelerometer data in X direction
accelerometer data in Y direction
accelerometer data in Z direction
counts to see how to produce counts.
sampleCounts
counts calculated by activityCounts and ActiLife
trunc
trunc(data, min_value)trunc(data, min_value)
data |
The input variable which will be altered if less than the threshold |
min_value |
the threshold which the input below it will be set to zero |
returns zero if the "data" is less than the "mean_value" otherwise returns the "data"