Skip to contents

Read ActiGraph sleep watch data from a database stored in an AGD file. Return a tibble. (Code is from actigraph.sleepr package https://github.com/dipetkov/actigraph.sleepr/. See LICENSE.note file in the app skeleton.)

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.

See also

Examples

file <- system.file("extdata", "acc.agd",
  package = "activAnalyzer"
)
read_agd(file)
#> # A tibble: 41,400 × 10
#>    timestamp           axis1 axis2 axis3 steps   lux inclineoff inclinestanding
#>  * <dttm>              <int> <int> <int> <int> <int>      <int>           <int>
#>  1 2021-04-07 06:00:00     0     0     0     0     0         10               0
#>  2 2021-04-07 06:00:10     0     0     0     0     0         10               0
#>  3 2021-04-07 06:00:20     0     0     0     0     0         10               0
#>  4 2021-04-07 06:00:30     0     0     0     0     0         10               0
#>  5 2021-04-07 06:00:40     0     0     0     0     0         10               0
#>  6 2021-04-07 06:00:50     0     0     0     0     0         10               0
#>  7 2021-04-07 06:01:00     0     0     0     0     0         10               0
#>  8 2021-04-07 06:01:10     0     0     0     0     0         10               0
#>  9 2021-04-07 06:01:20     0     0     0     0     0         10               0
#> 10 2021-04-07 06:01:30     0     0     0     0     0         10               0
#> # ℹ 41,390 more rows
#> # ℹ 2 more variables: inclinesitting <int>, inclinelying <int>