vec2ind | R Documentation |
A helper function for transforming a vector into an indicator matrix.
vec2ind(x, add_names = TRUE)
x |
A vector (which will internally be converted to a factor). |
add_names |
Logical specifying whether to add dimnames to the resulting indicator matrix. |
As of version 2.0.x of the svs
package, this is essentially a wrapper for
t(fac2sparse())
from the Matrix package.
An indicator matrix.
dat2ind
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.