View source: R/matrix_blocks.R
bkt | R Documentation |
Transpose a matrix by blocks, so block(s,r)
becomes block(r,s)
, but
elements within each block are not transposed.
bkt(df)
df |
A block matrix with named rows and columns. Names of countries and sectors are automatically identified. |
bkt()
takes a matrix of c1 x c2
blocks where each
block has a dimension s1 x s2
and transposes its blocks. Block
B21
becomes B12
, B31
becomes B13
, etc., but
blocks are not altered internally. For instance, a matrix with rows
5 exporting countries of 4 sectors each and columns with 3
importing countries with 2 aggregated sectors, i.e., a
(5 x 4) x (3 x 2), matrix will become a (3 x 4) x (5 x 2) matrix. The
rows will now show the importing countries and the sectors they import
from, and the columns will show the the exporting countries and the
sectors they export from.
Block transposed version of df
.
bktt()
.
wio <- make_wio("wiodtest", quiet = TRUE)
# Matrix Ym (exports of final products)
wio$Ym
# Block transposed version of Ym (imports of final products)
bkt(wio$Ym)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.