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
vector
byrow=FALSE
byrow=TRUE