get_list | R Documentation |
This function creates regular data frames with three columns (regions, industries, count) from (incidence) matrices (wide to long format) using the reshape2 package
get_list(mat)
mat |
An incidence matrix with regions in rows and industries in columns (or the other way around) |
A data frame with three columns: "Region" (representing the region), "Industry" (representing the industry), and "Count" (representing the count of occurrences)
Pierre-Alexandre Balland p.balland@uu.nl
get_matrix
## generate a region - industry matrix
set.seed(31)
mat <- matrix(sample(0:100, 20, replace = TRUE), ncol = 4)
rownames(mat) <- c("R1", "R2", "R3", "R4", "R5")
colnames(mat) <- c("I1", "I2", "I3", "I4")
## run the function
get_list(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.