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

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.
主站蜘蛛池模板: 清水县| 溧阳市| 金堂县| 安达市| 宁国市| 静乐县| 兰坪| 嘉兴市| 句容市| 全州县| 利津县| 侯马市| 拜泉县| 乐至县| 海晏县| 翼城县| 徐水县| 兴海县| 庄河市| 新野县| 石屏县| 图们市| 儋州市| 六枝特区| 诸城市| 思茅市| 克什克腾旗| 淳化县| 稷山县| 鸡西市| 鹿泉市| 苗栗县| 无棣县| 德昌县| 九寨沟县| 仙桃市| 东平县| 沁阳市| 天门市| 龙海市| 时尚|