contr_one_hot | R Documentation |
This contrast function produces a model matrix that has indicator columns for each level of each factor.
contr_one_hot(n, contrasts = TRUE, sparse = FALSE)
n |
A vector of character factor levels or the number of unique levels. |
contrasts |
This argument is for backwards compatibility and only the
default of |
sparse |
This argument is for backwards compatibility and only the
default of |
A diagonal matrix that is n
-by-n
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.