stepmetrics
Calculate Step and Cadence Metrics from Wearable Data
Description
Provides functions to calculate step- and cadence-based metrics from timestamped accelerometer and wearable device data. Supports CSV and AGD files from 'ActiGraph' devices, CSV files from 'Fitbit' devices, and step counts derived with R package 'GGIR' <https://github.com/wadpac/GGIR>, with automatic handling of epoch lengths from 1 to 60 seconds. Metrics include total steps, cadence peaks, minutes and steps in predefined cadence bands, and time and steps in moderate-to-vigorous physical activity (MVPA). Methods and thresholds are informed by the literature, e.g., Tudor-Locke and Rowe (2012) <doi:10.2165/11599170-000000000-00000>, Barreira et al. (2012) <doi:10.1249/MSS.0b013e318254f2a3>, and Tudor-Locke et al. (2018) <doi:10.1136/bjsports-2017-097628>. The package record is also available on Zenodo (2023) <doi:10.5281/zenodo.7858094>.
Downloads
169
Last 30 days
23361st
450
Last 90 days
1.2K
Last year
Trend: +9% (30d vs prior 30d)
CRAN Check Status
Show all 14 flavors
| Flavor | Status |
|---|---|
| r-devel-linux-x86_64-debian-clang | OK |
| r-devel-linux-x86_64-debian-gcc | OK |
| r-devel-linux-x86_64-fedora-clang | OK |
| r-devel-linux-x86_64-fedora-gcc | OK |
| r-devel-macos-arm64 | OK |
| r-devel-windows-x86_64 | ERROR |
| r-oldrel-macos-arm64 | OK |
| r-oldrel-macos-x86_64 | OK |
| r-oldrel-windows-x86_64 | OK |
| r-patched-linux-x86_64 | OK |
| r-release-linux-x86_64 | OK |
| r-release-macos-arm64 | OK |
| r-release-macos-x86_64 | OK |
| r-release-windows-x86_64 | OK |
Check details (1 non-OK)
tests
Running 'spelling.R' [0s]
Running 'testthat.R' [12s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(stepmetrics)
>
> test_check("stepmetrics")
Saving _problems/test-readFile-103.R
________________________________________________________________________________
Calculating features per day...
Processing participant: S001
________________________________________________________________________________
Calculating means per recording
Processing participant: S001
________________________________________________________________________________
Storing output...
...[truncated]...
________________________________________________________________________________
Calculating features per day...
Processing participant: 101
________________________________________________________________________________
Calculating means per recording
Processing participant: 101
________________________________________________________________________________
Storing output...
Analyses complete!
Your output is stored here: D:\temp\2026_04_03_01_50_00_16606\Rtmp0MSvUd\stepmetrics_out_193b026d6156
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 67 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-readFile.R:103:3'): reads and formats data correctly ─────────
Expected `unclass(as.POSIXct(ts, tz = "UTC"))` to be identical to `unclass(exp)`.
Differences:
`actual`: 1625312880.0
`expected`: 1625320080.0
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 67 ]
Error:
! Test failures.
Execution halted
Check History
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 10, 2026
tests
Running 'spelling.R' [0s]
Running 'testthat.R' [11s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where s
...[truncated]...
───
Expected `unclass(as.POSIXct(ts, tz = "UTC"))` to be identical to `unclass(exp)`.
Differences:
`actual`: 1625312880.0
`expected`: 1625320080.0
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 67 ]
Error:
! Test failures.
Execution halted