Skip to contents

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.

Value

description

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.

Examples

aggr_rep_lag(gdp_volume) |> plot()