vec {lazy.mat} | R Documentation |
Vectorization of a matrix
vec(A, byrow = 0)
A |
A matrix or vector |
byrow |
= 1 to get the row-major vectorization |
When A is a vector it will be converted to a column vector.
Same as matrix(A,,1)
. Column vector consisting of c(A)
.
Can be used with a character matrix.
A column vector of the size nrow(A)*ncol(A) times 1
vecA=vec(demomat(3,2)) A=matrix(vecA,3) # converting to a native vector with name vecA=vecA[,1,drop=1]