vec2ind {svs} | R Documentation |
Transform a Vector into an Indicator Matrix
Description
A helper function for transforming a vector into an indicator matrix.
Usage
vec2ind(x, add_names = TRUE)
Arguments
x |
A vector (which will internally be converted to a factor). |
add_names |
Logical specifying whether to add dimnames to the resulting indicator matrix. |
Details
As of version 2.0.x of the svs
package, this is essentially a wrapper for
t(fac2sparse())
from the Matrix package.
Value
An indicator matrix.
See Also
[Package svs version 3.1.1 Index]