aggr_rep_lag {IndexNumberTools} | R 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()
[Package IndexNumberTools version 1.1 Index]