alike(matrix(integer(), nrow = 3, dimnames = list(c("R", "G", 
    "B"), NULL)), matrix(1:9, nrow = 3, dimnames = list(NULL, 
    c("R", "G", "B"))))

row.names(matrix(1:9, nrow = 3, dimnames = list(NULL, c("R", 
    "G", "B"))))
should be type "character" (is "NULL")

[1] "row.names(matrix(1:9, nrow = 3, dimnames = list(NULL, c(\"R\", \n    \"G\", \"B\"))))\nshould be type \"character\" (is \"NULL\")"

alike(matrix(integer(), nrow = 3, dimnames = list(c("R", "G", 
    "B"), NULL)), matrix(1:9, nrow = 3, dimnames = list(c("R", 
    "G", "B"), c("bacon", "turkey", "bravo"))))

[1] "`1:9` should be \"matrix\" (is \"integer\")"

mx.tpl <- matrix(integer(), ncol = 3, dimnames = list(row.id = NULL, 
    c("R", "G", "B")))

mx.cur <- matrix(sample(0:255, 12), ncol = 3, dimnames = list(row.id = 1:4, 
    rgb = c("R", "G", "B")))

mx.cur2 <- matrix(sample(0:255, 12), ncol = 3, dimnames = list(1:4, 
    c("R", "G", "B")))

`dimnames(mx.cur2)` should have attribute "names"

[1] "`dimnames(mx.cur2)` should have attribute \"names\""

dn0 <- structure(list(c("a", "b"), "c"), attr1 = "a1", attrZ = 1)

dn1 <- structure(list(c("a", "b"), "c"), attr1 = "a1", attrBOB = "aa", 
    attrZ = 1)

dn2 <- structure(list(c("a", "b"), "c"), attr1 = "a1", attrJANE = "bb", 
    attrZ = 1)

mx.dn0 <- matrix(1:2, ncol = 1, dimnames = dn0)

mx.dn1 <- matrix(1:2, ncol = 1, dimnames = dn1)

mx.dn2 <- matrix(1:2, ncol = 1, dimnames = dn2)

`attr(dimnames(mx.dn0), "attrBOB")` should not be missing

[1] "`attr(dimnames(mx.dn0), \"attrBOB\")` should not be missing"

# Logic slightly different depending on lexical order of attributes
# for these next two; result should be the similar.

`attr(dimnames(mx.dn2), "attrBOB")` should not be missing

[1] "`attr(dimnames(mx.dn2), \"attrBOB\")` should not be missing"

`attr(dimnames(mx.dn1), "attrJANE")` should not be missing

[1] "`attr(dimnames(mx.dn1), \"attrJANE\")` should not be missing"

`1:3` should be class "data.frame" (is "integer")

[1] "`1:3` should be class \"data.frame\" (is \"integer\")"

`mtcars` should be type "integer-like" (is "list")