Attributes

z <- matrix(0, nrow = 3, ncol = 3)
attributes(z)
attr(z, "dim")
z
attr(z, "dim") <- 9
z
$dim
[1] 3 3

[1] 3 3
     [,1] [,2] [,3]
[1,]    0    0    0
[2,]    0    0    0
[3,]    0    0    0
[1] 0 0 0 0 0 0 0 0 0