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

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.
主站蜘蛛池模板: 平原县| 新乡市| 揭阳市| 庆阳市| 宣威市| 哈巴河县| 岚皋县| 昂仁县| 罗田县| 天镇县| 宜州市| 汾阳市| 双流县| 长春市| 常熟市| 渝中区| 泉州市| 廉江市| 永福县| 奎屯市| 额济纳旗| 淅川县| 平舆县| 彭泽县| 天水市| 阿拉善左旗| 惠州市| 宁远县| 明星| 昌黎县| 阿荣旗| 淮北市| 东乌珠穆沁旗| 南澳县| 牙克石市| 瓮安县| 廉江市| 巧家县| 炉霍县| 郁南县| 和平区|