Description Usage Arguments Author(s) Examples
Check if object is array (that it is a vector with a dim attribute) and that the object has dimnames and that dimnames are named.
1 2 3 4 5 6 7 8 9 | is.named.array(obj)
is_named_array_(obj)
is_number_vector_(obj)
is_dimnames_(obj)
dimnames_match(a1, a2)
|
obj |
Some R object. |
a1, a2 |
Arrays with named dimnames. |
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 22 23 24 25 26 27 28 | is.named.array( HairEyeColor )
is.named.array( matrix(1:4, nrow=2) )
is_named_array_( HairEyeColor )
is_named_array_( matrix(1:4, nrow=2) )
is_number_vector_(1:4)
is_number_vector_(list(1:4))
ar1 = tabNew(c("a", "b"), levels=c(2, 3))
ar2 = tabNew(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 = tabNew(c("a", "b"), levels=c(2, 3))
ar2 = tabNew(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 = tabNew(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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.