powered by
spread(M, ncol = 1, nrow = 1)
M = matrix(1:12, ncol=4) spread(M, ncol = 5, nrow = 7)
Run the code above in your browser using DataLab