powered by
Convert a vector to a matrix
v2matrix(x, ncol = 2, byrow = TRUE)
a matrix
vector
number of columns
logical. convert by row
v2matrix(c(1,2,3,4))
Run the code above in your browser using DataLab