| Iminus_byname | R Documentation |
I)The order of rows and columns of m may change before subtracting from I,
because the rows and columns are sorted by name prior to subtracting from I.
Furthermore, if m is not square, it will be made square
before subtracting from I by calling complete_and_sort().
Iminus_byname(a)
a |
The matrix to be subtracted from |
The difference between an identity matrix (I) and m.
(whose rows and columns have been completed and sorted)
m <- matrix(c(-21, -12, -21, -10), ncol = 2, dimnames = list(c("b", "a"), c("b", "a"))) %>%
setrowtype("Industries") %>% setcoltype("Commodities")
# Rows and columns are unsorted
diag(1, nrow = 2) - m
# Rows and columns are sorted prior to subtracting from the identity matrix
Iminus_byname(m)
# This also works with lists
Iminus_byname(list(m,m))
# If the m is not square before subtracting from I,
# it will be made square by the function complete_and_sort.
m2 <- matrix(c(1,2,3,4,5,6), ncol = 2, dimnames = list(c("a", "b", "c"), c("a", "b"))) %>%
setrowtype("Industries") %>% setcoltype("Commodities")
Iminus_byname(m2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.