Check that the intersection of dimnames of two arrays are identical.

1 2 3 | ```
dimnames_match(a1, a2)
dimnames_match_(tab1, tab2, verbose = FALSE)
``` |

`a1, a2, tab1, tab2` |
Arrays with named dimnames. |

`verbose` |
Should errors be printed. |

Søren Højsgaard, sorenh@math.aau.dk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
ar1 = newar(c("a","b"), levels=c(2,3))
ar2 = newar(c("c","a"), levels=c(2,2))
ar1
ar2
## dimension a has levels a1,a2 in both ar1 and ar2.
# Hence we have a match.
dimnames_match(ar1, ar2)
ar1 = newar(c("a","b"), levels=c(2,3))
ar2 = newar(c("c","a"), levels=c(2,3))
ar1
ar2
## dimension a has levels a1,a2 in ar1 and levels a1,a2,a3 in ar2.
# Hence we do not have a match.
dimnames_match(ar1, ar2)
ar2 = newar(c("c","a"), levels=list(c=c("c1","c2"), a=c("a2","a1")))
ar2
## dimension a has levels a1,a2 in ar1 and levels a2,a1 in ar2.
# Hence we do not have a match.
dimnames_match(ar1, ar2)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.