Manipulate the events data recorded by activPAL
process_events.Rd
Manipulate and clean the events data record by activPAL and imported by
read_events()
.
Arguments
- data
A
data.events
object produced byread_events()
.
Value
A process.data.events
object, which is a data.frame
containing
the variables discussed in the Details.
Details
This functions rearranges the variables produced by the activPAL software and selects the variables related to:
time
,datacount
,interval
,activity
,cummulativesteps
, andmethrs
.
The naming of variables is based on the archived package named
activpalProcessing
created by Kate Lynden.
Beyond variable selection, this function specifically:
doubles the
cumulativesteps
as the activPAL device is only on one leg,transforms the
time
variable to a date-time (POSIXct) numeric vector based on the UTC time-zone, andcreates several new variables to indicate:
wear day based on sleep onset (
wear_day
),sleep windows (
sleep_loop
),nap windows (
nap_loop
),wake windows (
wake_loop
), andwork windows (
work_loop
)
that are all missing values to be filled in later by the appropriate data.
Examples
if (FALSE) { # \dontrun{
dat <- read_events("0001-AB", "3")
process_dat <- process_events(data = dat)
} # }