m <- matrix(data = c(1:6),
nrow = 2, ncol = 3,
dimnames = list(c("p1", "p2"), c("i1", "i2", "i3"))) %>%
setrowtype(rowtype = "Products") %>% setcoltype(coltype = "Industries")
list_of_rows_or_cols(m, margin = 1)
list_of_rows_or_cols(m, margin = 2)
Run the code above in your browser using DataLab