Calculate Step Counts via stepcount
Source: R/acti_calculate_stepcount.R
acti_calculate_stepcount.RdUse the stepcount package to estimate steps from raw accelerometer data
and summarize them to minute-level epochs (as opposed to 10s default)
Arguments
- data
A
data.frame,AccDataobject, or GT3X file withX,Y,Z, andtime- sample_rate
Sample rate in Hz. If omitted, it is taken from the input object when available.
- ...
Additional arguments passed to
stepcount::stepcount()- epoch
epoch unit to aggregate the data to, passed to
lubridate::floor_date(), original output is at 10-seconds
Examples
# \donttest{
# reticulate::py_require("stepcount==3.11.0", python_version = "3.10", action = "add")
# sc = try({ reticulate::import("stepcount") })
if (stepcount::have_stepcount()) {
data = actiread::acti_read_gt3x(actiread::acti_example_gt3x())
steps = acti_calculate_stepcount(data, sample_rate = 100)
steps = acti_calculate_stepcount(data, model_type = "rf")
}
#> Warning: Python version requirements cannot be changed after Python has been initialized.
#> * Python version request: '3.10' (from package:stepcount)
#> * Python version initialized: '3.12.14'
# }