vec2ind: 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 be converted to a factor).
add_names
Logical specifying whether to add dimnames to the resulting indicator matrix.
Value
An indicator matrix.
Details
This is essentially the function class.ind from the package MASS.