View source: R/estimate_rest.R
| ar_read | R Documentation |
AcceleRest expects 30Hz, gravity-calibrated data without gaps. Device
files (.cwa, .gt3x, .bin, optionally compressed) are read with
actiread::acti_read(), and CSV files with readr::read_csv(). Gaps
(all-zero rows from ActiGraph idle sleep mode, and missing values) are
filled with the last observation carried forward using
actibase::acti_fill_zeros(), as ActiLife does. The data are then
low-pass filtered, calibrated, and resampled to 30Hz with the actipy
Python module, using the same settings as the AcceleRest command-line
tool. .h5 files must already be preprocessed, with an
axes x samples array in data/accelerometry.
ar_read(
file,
sample_rate = NULL,
fill_zeros = TRUE,
lowpass_hz = 15,
calibrate_gravity = TRUE,
detect_nonwear = FALSE,
verbose = FALSE,
...
)
file |
a |
sample_rate |
sample rate (Hz) of the data. If |
fill_zeros |
If |
lowpass_hz, calibrate_gravity, detect_nonwear |
preprocessing options
passed to |
verbose |
print diagnostic messages |
... |
additional arguments passed to |
A list with the Python (numpy) array of 3 x samples data
(accelerometry), the time of the first sample (start_time, NULL
for .h5 files), and actipy information about the data (info).
# Runs only after ar_setup(), so Python is not set up otherwise
if (ar_have_repo() && ar_have_weights() &&
ar_python_modules_installed()) {
data = ar_example_data(n_hours = 0.1)
out = ar_read(data)
out$start_time
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.