switch-notation | R Documentation |
IEA data can be "specified" by adding additional information. Three notations are useful: arrow, bracket, and from. Arrow notation is from -> to, and bracket notation is destination [source]. These functions change matrix row/column names among the notations.
arrow_to_from_byname()
switches from arrow notation to from notation.
from_to_arrow_byname()
switches from from notation to arrow notation.
arrow_to_bracket_byname()
switches from arrow notation to bracket notation.
bracket_to_arrow_byname()
switches from bracket notation to arrow notation.
Functions with the _byname
suffix behave like functions in the matsbyname
package.
Specifically, they can work with a single matrix or a list of matrices supplied to the m
argument.
arrow_to_from_byname(m, margin = c(1, 2))
from_to_arrow_byname(m, margin = c(1, 2))
arrow_to_bracket_byname(m, margin = c(1, 2))
bracket_to_arrow_byname(m, margin = c(1, 2))
m |
a single matrix or a list of matrices. |
margin |
the margin over which the notation switch should be made:
|
An object of same length as m
with switched notation.
m <- matrix(c(1, 2,
3, 4), nrow = 2, ncol = 2, byrow = TRUE,
dimnames = list(c("a -> b", "c -> d"), c("f [e]", "h [g]")))
m
arrow_to_from_byname(m)
arrow_to_from_byname(m, margin = 2) # No changes expected.
from_to_arrow_byname(m)
arrow_to_bracket_byname(m)
bracket_to_arrow_byname(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.