Learn R Programming

GENEAcore (version 1.1.2)

aggregate_periods: Aggregate Periods

Description

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

Usage

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

Value

Data frame of aggregated epochs or events.

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.