Learn R Programming

geeLite (version 1.0.2)

aggr_by_freq: Aggregate Data by Frequency

Description

Aggregates data from a wide-format data frame according to a specified frequency and applies aggregation and post-processing functions.

Usage

aggr_by_freq(
  table,
  freq,
  prep_fun,
  aggr_funs,
  postp_funs,
  variable_name,
  preprocess_body
)

Value

A data frame in wide format with aggregated values.

Arguments

table

[mandatory] (data.frame) A wide-format data frame.

freq

[mandatory] (character) Specifies the frequency to aggregate the data.

prep_fun

[mandatory] (function) Function used for pre-processing.

aggr_funs

[mandatory] (function or list) Aggregation function(s).

postp_funs

[mandatory] (function or list) Post-processing function(s).

variable_name

[mandatory] (character) Name of the current variable.

preprocess_body

[mandatory] (character) Body of the prep_fun function.