Parses a Condor ActTrust .txt export into a tidy tibble. The file
format consists of a variable-length key-value header block followed by
semicolon-delimited epoch rows. The header ends at the line beginning with
DATE/TIME.
Arguments
- path
character(1)orfs::path. Path to the ActTrust.txtfile.- tz
character(1). Time zone string passed tolubridate::parse_date_time(). Defaults to"UTC". Set to the local recording time zone for correct circadian alignment.- encoding
character(1). File encoding. Defaults to"latin1", which matches Condor's default export encoding.
Value
A tibble with one row per epoch and the following columns:
datetimePOSIXct— epoch timestamp.activitydouble— PIM activity count.int_tempdouble— internal (on-body) temperature, °C.ext_tempdouble— external (ambient) temperature, °C.NAif unavailable.ZCMndouble— normalised zero-crossing mode count.NAif unavailable.statedouble— state column, initialised to0.offwristdouble— off-wrist indicator, initialised to0.sleepdouble— sleep indicator, initialised to0.
The tibble carries a "zeitr_recording" class and a metadata attribute
(a named list with subject, device_id, device_model,
firmware_version, interval_s, source_file).
Examples
if (FALSE) { # \dontrun{
rec <- read_acttrust("recordings/P001.txt")
rec
attr(rec, "metadata")
} # }