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

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.
主站蜘蛛池模板: 竹山县| 深泽县| 酒泉市| 马尔康县| 常熟市| 吉安县| 诸城市| 潮安县| 习水县| 繁昌县| 安达市| 诸暨市| 江门市| 宕昌县| 略阳县| 拜城县| 贵州省| 明溪县| 新巴尔虎右旗| 阳江市| 来安县| 都安| 靖边县| 咸丰县| 方正县| 绥中县| 涿州市| 岚皋县| 临江市| 周至县| 淄博市| 墨脱县| 山东| 贺州市| 新竹县| 宜宾市| 易门县| 如东县| 成都市| 盐池县| SHOW|