load_agd_data: Load the 'data' table from an ActiGraph '.agd' file.

View source: R/load-agd-data.R

load_agd_dataR Documentation

Load the data table from an ActiGraph .agd file.

Description

This function loads the data table from an ActiGraph .agd file.

Usage

load_agd_data(
  file,
  col_select = "everything",
  day_max = 7,
  start_date,
  settings
)

Arguments

file

Required: a length-one character vector representing the full path to an .agd file.

col_select

Required (default: "everything"): a character vector representing which vectors to load.

day_max

Required (default: 7): a length-one integer vector representing the maximum number of days of data to load from file.

start_date

Optional: a length-one date vector (format: yyyy-mm-dd) representing the first day of data to load from file. If not set, data will be loaded from the first available day until day_max is reached.

settings

Optional: a tibble from file previously returned from load_agd_settings().

Value

Returns a tibble of the data table.

Examples

# Initialize agd_worker R6 class
agd_data <- agd_worker$new(
  id = "jane-canuck",
  age = 10,
  agd_lfe = system.file("extdata", "jane-canuck-lfe.agd", package = "chms"),
  agd_nml = system.file("extdata", "jane-canuck-nml.agd", package = "chms"),
  epoch_length = 15,
  day_max = 3,
  sleep_algo = "barreira",
  non_wear_algo = "barreira"
)

# Load data with low frequency extension
dt <- load_agd_data(
  file = agd_data$args$agd_lfe,
  start_date = agd_data$args$start_date
)

chms documentation built on Oct. 17, 2026, 5:07 p.m.