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

How it works…

The matrix() function takes the input of as a vector, number of rows, number of columns, and whether the arrangement should be by row or not. The function then places the elements of the vector into a two-dimensional arrangement based on the nrow and ncol values. By default, it fills the elements column by column if byrow is not explicitly specified. However, if byrow=TRUE is specified, then the elements fill by one row at a time.

The cbind() and rbind() functions are very similar to the concatenation function c(), but the cbind() function places the vector as columns in a two-dimensional representation and rbind() places the vectors as rows in a two-dimensional representation to create a matrix.

The array() function takes two necessary inputs: one is a vector of elements and another is a vector of dimensions. If you use only two numbers in the dim = argument, then this function will create a matrix and the elements will be filled column by column.

主站蜘蛛池模板: 孟州市| 明水县| 松阳县| 商洛市| 晋州市| 赤城县| 通州区| 时尚| 北川| 犍为县| 康平县| 伊吾县| 龙游县| 屯留县| 平舆县| 海淀区| 台东县| 景洪市| 临澧县| 南宫市| 澎湖县| 巴彦县| 平顶山市| 连江县| 泸水县| 手游| 泰顺县| 阿拉善左旗| 井陉县| 化德县| 武陟县| 临邑县| 株洲县| 兴仁县| 清镇市| 什邡市| 思茅市| 西宁市| 万盛区| 筠连县| 孝昌县|