You can either set the dimnames
argument when defining the array:
ar <- array(data = 1:27,
dim = c(3, 3, 3),
dimnames = list(c("a", "b", "c"),
c("d", "e", "f"),
c("g", "h", "i")))
and/or you can set the dimnames
of the third dimension like so:
dimnames(ar)[[3]] <- c("G", "H", "I")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…