Read GT3X file
Usage
acti_read_gt3x(
path,
asDataFrame = TRUE,
imputeZeroes = TRUE,
verbose = TRUE,
...,
digits = 3L,
fill_zeroes = TRUE,
apply_tz = FALSE,
check_attributes = TRUE,
tz = "GMT"
)
acti_info_gt3x(path, ...)Arguments
- path
Path to gt3x file
- asDataFrame
convert to an
activity_df, seeas.data.frame.activity- imputeZeroes
Impute zeros in case there are missingness? Default is
TRUE. IfFALSE, the time series will be incomplete in case there is missingness.- verbose
print diagnostic messages, higher values = more verbosity.
- ...
additional arguments to pass to
read.gt3x::read.gt3x()- digits
number of digits to round the acceleration values to, passed to
read.gt3x::read.gt3x()(requiresread.gt3x >= 1.3.0). The default3Lmatches bothread.gt3x::read.gt3x()and ActiLife, so the data agree with ActiLife exports. Set toNULLto use theread.gt3x::read.gt3x()default. If you will resample the data (e.g. to 30 Hz for activity counts), read withdigitsof at least6L(e.g.8L), resample, and then round to 3 digits: rounding to 3 before resampling loses precision, and rounding values already rounded to 5 digits rounds twice (e.g.0.1234996to0.12350to0.124).- fill_zeroes
Rows with all zeros will be filled in with the last observation carried forward as is done with ActiLife. Recommended
- apply_tz
Apply the timezone from the header
TimeZoneattribute, if available- check_attributes
Check that the attributes are included This is a sanity check, including checking that
sample_rateis in the attributes.- tz
timezone to display the data in when
apply_tz = TRUE. The data read in viaread.gt3x::read.gt3x()says the timezone is GMT, but the time values are the device's local clock time. Whenapply_tz = TRUE, the headerTimeZoneoffset is used to recover the true time, which is then shown intz(the default"GMT"gives UTC times). Set toNULLto keep the fixed-offset zone from the header (e.g."Etc/GMT+4"for-04:00), or UTC if the offset is not a whole number of hours.
Examples
library(actiread)
data = acti_read_gt3x(acti_example_gt3x())
#> ℹ Filling zeros in data
#> ✔ Filled zeros in data
#> ℹ Timezone not applied to data
data = acti_read_gt3x(
acti_example_gt3x(),
tz = NULL,
apply_tz = FALSE,
verbose = FALSE,
fill_zeroes = FALSE
)
info = acti_info_gt3x(acti_example_gt3x())