get_matrix: Get a matrix version of a balanced panel

Description Usage Arguments Value Examples

View source: R/pca_functions.R

Description

Convert a balanced panel tbl into a matrix, id_var as rows, t_var as columns

Usage

1
get_matrix(tbl, id_var = id, t_var = year, x_var = g_i)

Arguments

tbl

A tbl of panel data

id_var

The (quoted or unquoted) name of the id variable

t_var

The (quoted or unquoted) name of the time variable

x_var

The (quoted or unquoted) name of the variable to put in the matrix

Value

A matrix

Examples

1
2
asm <- fakedata::fake_panel(N = 50, T = 10, missing = 0.1)
get_matrix(asm, id, year, g)

tweed1e/idiosyncratics documentation built on May 29, 2019, 10:51 a.m.