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

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.
主站蜘蛛池模板: 舞钢市| 青海省| 马鞍山市| 姜堰市| 会同县| 都兰县| 龙南县| 新郑市| 梁平县| 芦溪县| 西昌市| 怀安县| 元阳县| 伊春市| 南城县| 梅州市| 渝中区| 乌苏市| 吉木萨尔县| 五寨县| 都江堰市| 虞城县| 荆州市| 乐亭县| 南城县| 平罗县| 隆尧县| 怀柔区| 潼关县| 白河县| 苍山县| 南召县| 小金县| 门头沟区| 翁牛特旗| 井陉县| 于田县| 万荣县| 兴安盟| 阜康市| 东莞市|