The basic syntax for creating a matrix in R is −. matrix(data, nrow, ncol, byrow, dimnames) Following is the description of the parameters used −. data is the input vector which becomes the data elements of the matrix.
For More Information Please Refer: