Matrix(0, 3, 2) # a 3 by 2 matrix of zeros
Matrix(1:6, 3, 2) # a 3 by 2 matrix
Matrix(1:6, nrow=3)
Matrix(1:6, ncol=2)
Matrix(1:9, nrow=3,
dimnames = list(c("a", "b", "c"), c("A", "B", "C")))
Run the code above in your browser using DataLab