aggregatePeriods: Aggregate Periods

View source: R/aggregate_periods.R

aggregatePeriodsR Documentation

Aggregate Periods

Description

Generalised aggregation function generates distinct epochs or events outputs based on the initial parameters provided.

Usage

aggregatePeriods(
  time_series,
  measure = "AGSA",
  time = "timestamp",
  sample_frequency,
  duration = NA,
  first_epoch_timestamp = NA,
  events = NA,
  start_time = "start",
  end_time = "end",
  fun = mean
)

Arguments

time_series

Data frame to be aggregated.

measure

Name of the measure columns to be included.

time

Name of the time column.

sample_frequency

Frequency of data.

duration

Time duration to aggregate in each epoch.

first_epoch_timestamp

Time to start the first epoch, defaults to first record.

events

Data frame containing the start and end index of each event.

start_time

Name of the column in events containing the start index of the events.

end_time

Name of the column in events containing the end index of the events.

fun

Function to apply on aggregation, defaults to mean.

Value

Data frame of aggregated epochs or events.


GENEAcore documentation built on April 11, 2025, 5:43 p.m.