time_invariant_to_panel: time_invariant_to_panel

View source: R/BMisc.R

time_invariant_to_panelR Documentation

time_invariant_to_panel

Description

This function takes a time-invariant variable and repeats it for each period in a panel data set.

Usage

time_invariant_to_panel(x, df, idname, balanced_panel = TRUE)

Arguments

x

a vector of length equal to the number of unique ids in df.

df

the data.frame used in the function

idname

name of column that holds the unit id

balanced_panel

a logical indicating whether the panel is balanced. If TRUE, the function will optimize the repetition process. Default is TRUE.

Value

a vector of length equal to the number of rows in df.


bcallaway11/BMisc documentation built on Jan. 12, 2025, 9:11 a.m.