vec2mat | R Documentation |
Convert a vector to a matrix
vec2mat(v, axis = c("col", "row"))
v |
Vector. |
axis |
One of |
The vector v
as a matrix.
If axis=="col"
(default) the column vector v
is returned as a length(v)
times 1
matrix.
If axis=="row"
, the vector v
is returned as a transposed 1
times length(v)
matrix.
vec2mat(c(2, 7, 3, 8), "col")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.