官术网_书友最值得收藏!

There's more…

You can give a name to each dimension of an array using the optional argument dim names inside the array() function. For example, take a look at the following code snippet:

    column.names <- c("COL1","COL2")
row.names <- c("ROW1","ROW2")
matrix.names <- c("m1","m2", "m3", "m4")
arrayB <- array(1:16, dim=c(2,2,4), dimnames =list(row.names,
column.names, matrix.names))
The dimension of the matrices inside an array should be the same and the data type must be the same as well.

You can also easily change the layout of the array by simply changing the dimension as follows:

    dim(arrayA) <- c(2,4,2)
The multiplication of all dimensions (2 x 4 x 2) should be the same as the total number of elements in the array.
主站蜘蛛池模板: 靖江市| 枞阳县| 慈利县| 越西县| 临澧县| 鄢陵县| 湘阴县| 双江| 游戏| 自贡市| 上饶市| 琼中| 神农架林区| 连城县| 开江县| 泊头市| 十堰市| 宁乡县| 邵东县| 姚安县| 马边| 天峻县| 鄂托克旗| 金华市| 林甸县| 肥东县| 宜章县| 阳江市| 汨罗市| 怀宁县| 阳新县| 大安市| 龙门县| 天柱县| 正安县| 岑巩县| 伊川县| 璧山县| 青神县| 罗平县| 永吉县|