read_agd: Read activity counts from an *.agd file

View source: R/read_agd.R

read_agdR Documentation

Read activity counts from an *.agd file

Description

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

Usage

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 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. https://actigraphcorp.com/support/manuals/actilife-6-manual/

See Also

read_agd_raw()

Examples

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")

dipetkov/actigraph.sleepr documentation built on March 25, 2022, 2:33 a.m.