read_agd: Read activity counts from an *.agd file

Description Usage Arguments Value References See Also Examples

View source: R/read_agd.R

Description

Read ActiGraph sleep watch data from a database stored in an AGD file. Return a tibble.

Usage

1
read_agd(file, tz = "UTC")

Arguments

file

Full path to an agd file to read.

tz

Time zone to convert DateTime ticks to POSIX time.

Value

A tibble (tbl) of activity data with at least two columns: timestamp and axis1 counts. Optional columns include axis2, axis2, steps, lux and inclinometer indicators (incline off, standing, sitting and lying). The device settings are stored as attributes, which include epochlength.

References

The AGD file format is described in the ActiLife 6 Manual.

See Also

read_agd_raw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
file <- system.file("extdata", "GT3XPlus-RawData-Day01.agd",
  package = "actigraph.sleepr"
)
read_agd(file)

library("dplyr")
library("purrr")

# Read ActiGraph sleep watch data from the AGD files in a directory
# and bind the data into one data frame indexed by `.filename`.
path <- system.file("extdata", package = "actigraph.sleepr")

list.files(path, pattern = "*.agd", full.names = TRUE) %>%
  map_dfr(read_agd, .id = ".filename")

oslerinhealth/actigraph.sleepr documentation built on May 25, 2021, 1:06 p.m.