R/Binary.R
samestructure_byname.Rd
Matrices are said to have the same structure if row and column types are identical and if row and column names are identical. Values can be different.
samestructure_byname(...)
... | operands to be compared |
---|
TRUE
if all operands have the same structure, FALSE
otherwise.
samestructure_byname(2, 2)#> [1] TRUEproductnames <- c("p1", "p2") industrynames <- c("i1", "i2") U <- matrix(1:4, ncol = 2, dimnames = list(productnames, industrynames)) %>% setrowtype("Products") %>% setcoltype("Industries") samestructure_byname(U, U)#> [1] TRUE#> [1] FALSE#> [1] FALSE#> [[1]] #> [1] TRUE #> #> [[2]] #> [1] TRUE #>