Skip to contents

Manipulate and clean the events data record by activPAL and imported by read_events().

Usage

process_events(data)

Arguments

data

A data.events object produced by read_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, and

  • methrs.

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, and

  • creates 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), and

    • work 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)
} # }