Description Usage Arguments Value Note Author(s) See Also Examples
Are the dimnames dn NULL-like?
is.null.DN(dn) is less strict than is.null(dn),
because it is also true (TRUE) when the dimnames
dn are “like” NULL, or list(NULL,NULL), as
they can easily be for the traditional R matrices
(matrix) which have no formal class
definition, and hence much freedom in how their dimnames
look like.
1 | is.null.DN(dn)
|
dn |
|
logical TRUE or FALSE.
This function is really to be used on “traditional” matrices
rather than those inheriting from Matrix, as
the latter will always have dimnames list(NULL,NULL) exactly,
in such a case.
Martin Maechler
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | m <- matrix(round(100 * rnorm(6)), 2,3); m1 <- m2 <- m3 <- m4 <- m
dimnames(m1) <- list(NULL, NULL)
dimnames(m2) <- list(NULL, character())
dimnames(m3) <- rev(dimnames(m2))
dimnames(m4) <- rep(list(character()),2)
m4 ## prints absolutely identically to m
stopifnot(m == m1, m1 == m2, m2 == m3, m3 == m4,
identical(capture.output(m) -> cm,
capture.output(m1)),
identical(cm, capture.output(m2)),
identical(cm, capture.output(m3)),
identical(cm, capture.output(m4)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.