rowColVector | R Documentation |
This utility function converts a plain vector into a row or column vector, i.e. a single-row or single-column matrix.
rowVector(x, label=NULL)
colVector(x, label=NULL)
x |
a (typically numeric) vector |
label |
an optional character string specifying a label for the single row or column returned |
A single-row or single-column matrix of the same data type as x
.
Labels of x
are preserved as column/row names of the matrix.
See matrix
for details on how non-atomic objects are handled.
Stephanie Evert (https://purl.org/stephanie.evert)
rowVector(1:5, "myvec")
colVector(c(A=1, B=2, C=3), label="myvec")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.