Device discovery, status, settings, and data download for accelerometer devices.
axR talks to Axivity AX3/AX6 accelerometers over USB: discovering connected
devices, querying and setting status/configuration, and downloading recorded
.cwa files. It also parses those .cwa files directly, and -- as of a
recent addition -- Condor Instruments ActTrust .txt actigraphy exports,
into the same tidy epoch shape.
Rather than reimplementing the Axivity serial protocol directly, axR wraps
the Open Movement Project's
OMAPI C library
(vendored in src/omapi, BSD 2-clause, Newcastle University โ see
src/omapi/LICENSE.TXT). OMAPI is the same library
behind Axivity's own OmGui software, and includes maintained,
platform-specific device discovery (IOKit/DiskArbitration on macOS, SetupAPI
on Windows, udev on Linux) rather than a hand-rolled equivalent.
axR is deliberately mostly a "dumb pipe" โ it talks to the device and
moves bytes, leaving higher-level actigraphy analysis to downstream
packages such as mrpheus or
zeitR. axivity_read_cwa()
and read_acttrust() are deliberate exceptions: OMAPI already
ships a complete .cwa reader, and ActTrust's .txt export format is a
plain, well-specified text format -- so axR wraps/parses both directly
rather than building a second, differently-sourced parser for either.
read_acttrust() deliberately stops at device-format parsing, though: it
returns the file's own epoch columns with no pipeline-specific columns or
classes added, leaving that reshaping to downstream packages (e.g. zeitR),
the same way axivity_read_cwa() does.
[!WARNING] axR has not been fully verified against real hardware. Live-device testing was performed on macOS and a real AX3.
timestamp/x/y/z/device_idfromaxivity_read_cwa()have been verified correct against a real recording;temperature_chas not, and is likely wrong on at least some hardware revisions. Not tested against an AX6.
axivity_discover()
axivity_send_command() escape hatchaxivity_reset() (erase +
commit, with none/delete/quickformat/wipe levels)axivity_stage_device() โ one-call deployment staging: sets
accelerometer config, deployment window (as start/stop or
start/duration), session ID, and metadata, then commits with
axivity_reset(). For finer control, the underlying axivity_set_*()
functions and axivity_reset() remain available individuallyaxivity_download(), backed by OMAPI's own background
download thread (progress polling and cancellation included), not a
plain file copyaxivity_copy_data() โ fallback: plain file copy from a mounted
device volume, bypassing OMAPI/device_id entirely, for when
axivity_discover() isn't finding the device but its mass-storage mount
still worksaxivity_read_cwa() โ parse a .cwa/AX6 file directly (via OMAPI's
own binary reader) into a tibble ready for downstream actigraphy analysis
โ no live device or prior discovery requiredread_acttrust() โ parse a Condor Instruments ActTrust .txt
export into the same tidy epoch shape, as a device-agnostic actigraphy
import layer alongside axivity_read_cwa() -- no live device requiredaxivity_enable_debug_log() โ re-enable OMAPI's internal diagnostic
trace, for debugging device-detection issuesThere's no axivity_open()/close() step โ the OMAPI session starts when
axR is loaded and stops when it's unloaded. Every device-facing function
takes a device_id from axivity_discover().
axR/
โโโ configure # generates src/Makevars at install time (chmod +x!)
โโโ cleanup # removes configure/build artefacts (chmod +x!)
โโโ R/
โ โโโ axR-package.R # package-level documentation
โ โโโ zzz.R # .onLoad/.onUnload (OmStartup/OmShutdown), .om_check()
โ โโโ discover.R # axivity_discover(), axivity_enable_debug_log()
โ โโโ status.R # battery, self-test, memory health, accelerometer,
โ โ # RTC, LED, lock, ECC, send_command
โ โโโ settings.R # delays, session ID, metadata, accel config, reset
โ โโโ stage.R # axivity_stage_device() -- one-call deployment staging
โ โโโ download.R # data info, download, download_status/wait/cancel,
โ โ # axivity_copy_data()
โ โโโ read_cwa.R # axivity_read_cwa()
โ โโโ read_acttrust.R # read_acttrust()
โ โโโ utils.R # internal message helpers (axr_abort/warn/inform), %||%
โโโ src/
โ โโโ axR-omapi.cpp # thin Rcpp wrapper around OMAPI
โ โโโ omapi/ # vendored OMAPI C library (BSD 2-clause), with
โ โ # axR patches -- see inline comments and NEWS.md
โ โโโ Makevars.in # template; configure fills in the platform-specific bits
โ โโโ Makevars.win # Windows build config (static, no template needed)
โโโ vignettes/
โ โโโ axR.Rmd.orig # real vignette source (not shipped)
โ โโโ axR.Rmd # pre-computed output, knitr::knit()'d from .orig
โโโ tests/testthat/
โโโ man/figures/
โ โโโ logo.svg
โ โโโ logo.png
โโโ pkgdown/favicon/ # via pkgdown::build_favicons()
โโโ .github/workflows/ # R-CMD-check.yaml, pkgdown.yaml
โโโ _pkgdown.yml
โโโ DESCRIPTION
โโโ NEWS.md
libudev-dev (or equivalent) for device discoveryInstall from r-universe (recommended โ pre-built binaries):
install.packages(
"axR",
repos = c("https://circadia-bio.r-universe.dev", "https://cloud.r-project.org")
)
Or install the development version from GitHub:
install.packages("pak")
pak::pak("circadia-bio/axR")
Linux only: r-universe's pre-built binaries don't bundle system
libraries โ libudev-dev (or equivalent) still needs to be installed
separately on the machine running R, regardless of install method.
vignette("axR")
Walks through discovery, status/settings, deployment staging with
axivity_stage_device(), downloading, the axivity_copy_data()
fallback, and reading .cwa files with axivity_read_cwa().
| Package | Type | Purpose |
|---|---|---|
| Rcpp | Imports | Bridges R to the vendored OMAPI C library |
| cli | Imports |
read_acttrust()'s error/warning messages |
| lubridate | Imports |
read_acttrust()'s flexible date-time parsing |
| tibble | Suggests |
axivity_read_cwa()/read_acttrust()'s return type (falls back to a plain data frame if absent) |
| testthat | Suggests | Test suite |
| covr | Suggests | Coverage reporting |
| knitr, rmarkdown, pkgdown | Suggests | Vignette and documentation site |
| Role | Name | Affiliation |
|---|---|---|
| Author, maintainer | Lucas Franรงa | Circadia Lab, Northumbria University |
| Author | Mario Leocadio-Miguel | Circadia Lab, Northumbria University |
| Author | Daniel Jackson | Northumbria University |
If you use axR in your research, please cite it:
@software{franca_axr_2026,
author = {Franรงa, Lucas and Leocadio-Miguel, Mario and Jackson, Daniel},
title = {{axR}: Interfacing and Retrieving Data from Accelerometer Devices},
year = {2026},
version = {0.1.3},
doi = {10.5281/zenodo.21393892},
url = {https://github.com/circadia-bio/axR}
}
Released under the MIT License. Vendored OMAPI code in
src/omapi is BSD 2-clause, Copyright ยฉ Newcastle University โ see
src/omapi/LICENSE.TXT.
Copyright ยฉ Lucas Franรงa, Mario Leocadio-Miguel & Daniel Jackson, 2026