array-dimnames: Check compatibility of dimnames

Description Usage Arguments Author(s) See Also Examples

Description

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

Usage

1

Arguments

a1, a2

Arrays with named dimnames.

Author(s)

S<c3><b8>ren H<c3><b8>jsgaard, [email protected]

See Also

is.named.array

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
ar1 = ar_new(c("a", "b"), levels=c(2, 3))
ar2 = ar_new(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 = ar_new(c("a", "b"), levels=c(2, 3))
ar2 = ar_new(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 = ar_new(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)

gRbase documentation built on May 29, 2017, 9:06 p.m.