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

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.
主站蜘蛛池模板: 义乌市| 江源县| 慈利县| 南昌县| 历史| 芦山县| 石家庄市| 甘孜县| 印江| 政和县| 神池县| 马尔康县| 方正县| 剑阁县| 南陵县| 茂名市| 翼城县| 兰西县| 驻马店市| 麻江县| 陇西县| 金昌市| 武安市| 南澳县| 通城县| 罗平县| 揭东县| 永兴县| 山东省| 忻城县| 宜宾县| 象州县| 靖安县| 嘉荫县| 长子县| 兴隆县| 乌兰县| 桂林市| 红原县| 湘阴县| 卓资县|