powered by
Reshape(a, n, m)
a
An error results if a does not have n*m elements. If m is missing, it will be calculated from n and the size of a.
n*m
m
n
a <- matrix(1:12, nrow=4, ncol=3) Reshape(a, 6, 2) Reshape(a, 6) # the same Reshape(a, 3, 4)
Run the code above in your browser using DataLab