Learn R Programming

matsbyname (version 0.6.11)

transpose_byname: Transpose a matrix by name

Description

Gives the transpose of a matrix or list of matrices.

Usage

transpose_byname(a)

Value

The transposed matrix.

Arguments

a

The matrix to be transposed.

Examples

Run this code
m <- matrix(c(11,21,31,12,22,32), ncol = 2, dimnames = list(paste0("i", 1:3), paste0("c", 1:2))) %>%
  setrowtype("Industry") %>% setcoltype("Commodity")
m
transpose_byname(m)
transpose_byname(list(m,m))

Run the code above in your browser using DataLab