pan_regularise: Regularise panel data.

Description Usage Arguments Details Value Examples

Description

Regularise a panel with non-existing rows or timesteps within the series. The panel will be extend per group to the longest temporal coverage across groups to make a balanced panel (at least in the group and time variables). The series will be padded with NAs.

Usage

1

Arguments

x

A data.frame or data.table.

g

An atomic character, name of the panel group variable in x.

t

An atomic character, name of the panel time variable in x.

Details

Currently supported are yearly, quaterly, and monthly data.

Value

A data.frame or data.table depending on the input.

Examples

1
2
3
4
5
6
7
x <- data.frame(
 yr = rep(2000:2002, 2),
 grp = rep(c("A", "B"), each = 3),
 val = 1:6
 )
x <- x[-2, ]
x_reg <- pan_regularise(x, "grp", "yr")

thorepet/thoremisc documentation built on Oct. 8, 2021, 7:48 a.m.