Transforms the output of read_acttrust() (or any reader that returns a
compatible tibble) into the working data frame expected by all detection
functions. Specifically:
Arguments
- x
A tibble as returned by
read_acttrust(), containing at minimumint_tempandext_tempcolumns.
Value
A tibble of the same dimensions as x with additional or updated
columns: state, offwrist, sleep, int_temp_, ext_temp_.
Details
Clamps
int_tempandext_tempto the physiological range [0, 42] °C.Adds min-max scaled temperature columns
int_temp_andext_temp_(range [0, 1]) for plotting.Ensures
state,offwrist, andsleepcolumns are present and initialised to0.
The original tibble is never modified; a copy is returned.
Examples
if (FALSE) { # \dontrun{
rec <- read_acttrust("recordings/P001.txt")
prep <- prepare_actigraphy(rec)
} # }