aggr_rep_lag: Aggregate, repeat and lag

View source: R/functions.R

aggr_rep_lagR Documentation

Aggregate, repeat and lag

Description

Helper function to repeat the aggregate annual value of a series on each period, and possibly lag it.

Usage

aggr_rep_lag(x, fun = mean, k = 0)

Arguments

x

(ts) Any time series

fun

(function) Aggregation function, mean by default

k

(int) Units to lag.

Details

Applies aggregate.ts to the series to get the annual values and then repeats those values for every subyear period.

The k parameter is passed to stats::lag.

Value

description

Examples

aggr_rep_lag(gdp_volume) |> plot()

IndexNumberTools documentation built on April 3, 2025, 6:10 p.m.