summary.agd: Summary method for the agd R6 class.

View source: R/summary.agd.R

summary.agdR Documentation

Summary method for the agd R6 class.

Description

This method renders summary tibbles for waking and sleeping hours from an agd object to the console.

Usage

## S3 method for class 'agd'
summary(object, ..., row_max = 10)

Arguments

object

Required: an agd_worker object.

...

Optional: additional arguments affecting the summary produced. Note: currently not used.

row_max

Required (default: 10): a length-one integer vector representing the number of rows of summary data to render to the console.

Value

Returns NULL invisibly.

Examples

# Create meta data frame (external/non-statcan users)
meta <- data.frame(
  id = c("jane-canuck", "john-canuck"),
  age = c(10, 40),
  agd_lfe = c(
    system.file("extdata", "jane-canuck-lfe.agd", package = "chms"),
    system.file("extdata", "john-canuck-lfe.agd", package = "chms")
  ),
  agd_nml = c(
    system.file("extdata", "jane-canuck-nml.agd", package = "chms"),
    system.file("extdata", "john-canuck-nml.agd", package = "chms")
  ),
  start_date = c("2021-05-30", "2021-05-27"),
  epoch_length = c(15, 60)
)

# Initialize agd R6 class
agd_data <- agd$new(
  id = meta$id,
  age = meta$age,
  agd_lfe = meta$agd_lfe,
  agd_nml = meta$agd_nml,
  epoch_length = meta$epoch_length,
  day_max = 2,
  sleep_algo = "barreira",
  non_wear_algo = "barreira",
  start_date = meta$start_date,
  cpu_max = 1
)

# Run data processing pipeline (load, clean, classify and summarize data)
agd_data$run()

# Summarize data
summary(agd_data)

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