pmpp_data: Transform a single variable in the matrix format into the...

Description Usage Arguments Value Author(s) Examples

View source: R/pmpp_data.R

Description

This function transforms a matrix of data with cross-sectional and time dimensions in rows and columns or columns and rows into a panel-structured, 3-column data frame

Usage

1
pmpp_data(indata, t_dim = "cols", var_name = "Y")

Arguments

indata

matrix with a single variable

t_dim

character string, one of: 'cols', 'rows'; whether time dimension in indata is across columns or rows

var_name

character string; name of the variable in indata

Value

A data.frame with 3 columns: unit, time and variable's values.

Author(s)

Michal Oleszak

Examples

1
2
3
set.seed(1)
matrix_var <- matrix(rnorm(100), nrow = 20)
panel_var <- pmpp_data(matrix_var)

pmpp documentation built on Oct. 30, 2019, 11:35 a.m.