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

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.

主站蜘蛛池模板: 同仁县| 塔城市| 开鲁县| 静宁县| 韶关市| 胶南市| 建德市| 海伦市| 邮箱| 阿拉尔市| 甘谷县| 福泉市| 建始县| 闽清县| 五华县| 巴彦淖尔市| 张北县| 江津市| 天津市| 大渡口区| 文登市| 富川| 永春县| 两当县| 正蓝旗| 沈丘县| 秦皇岛市| 遂平县| 常宁市| 秭归县| 修文县| 蓬安县| 禄劝| 手游| 昭通市| 乌审旗| 兴隆县| 闽侯县| 邵阳市| 建宁县| 隆林|