矩阵(R语言)

mymatrix <- matrix(vector, nrow=number_of_rows, ncol=number_of_columns,byrow=logical_value,dimnames=list(char_vector_rownames,char_vector_colnames))

vector: elements of the matrix
byrow=FALSE: by column (by default)
byrow=TRUE:by row

原文地址:https://www.cnblogs.com/yaos/p/7079294.html