get.list: Create regular data frames from regions - industries matrices

Description Usage Arguments Author(s) See Also Examples

View source: R/get.list.r

Description

This function creates regular data frames with three columns (regions, industries, count) from (incidence) matrices (wide to long format) using the reshape2 package

Usage

1
get.list (data)

Arguments

mat

An incidence matrix with regions in rows and industries in columns (or the other way around)

sparse

Logical; is the input a sparse matrix? Defaults to FALSE

Author(s)

Pierre-Alexandre Balland p.balland@uu.nl

See Also

get.matrix

Examples

1
2
3
4
5
6
7
8
## generate a region - industry matrix
set.seed(31)
mat <- matrix(sample(0:100,20,replace=T), ncol = 4)
rownames(mat) <- c ("R1", "R2", "R3", "R4", "R5")
colnames(mat) <- c ("I1", "I2", "I3", "I4")

## run the function
get.list (mat)

PABalland/EconGeo documentation built on Nov. 13, 2020, 2:50 a.m.