m <- matrix(c(1, 2,
3, 4), nrow = 2, ncol = 2, byrow = TRUE,
dimnames = list(c("b [a]", "d [c]"), c("f [e]", "h [g]"))) %>%
setrowtype("Products [Industries]") %>% setcoltype("Industries [Products]")
m
switch_notation_byname(m, from = RCLabels::bracket_notation, to = RCLabels::arrow_notation,
flip = TRUE)
# Also works for lists.
# Note that margin must be specified as a list here.
switch_notation_byname(list(m, m), margin = list(c(1, 2)),
from = RCLabels::bracket_notation,
to = RCLabels::arrow_notation, flip = TRUE)
Run the code above in your browser using DataLab