powered by
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)
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.
x
See matrix for details on how non-atomic objects are handled.
matrix
a (typically numeric) vector
an optional character string specifying a label for the single row or column returned
Stephanie Evert (https://purl.org/stephanie.evert)
rowVector(1:5, "myvec") colVector(c(A=1, B=2, C=3), label="myvec")
Run the code above in your browser using DataLab