contrast_one_hot | R Documentation |
This contrast function produces a model matrix that has indicator columns for each level of each factor.
contrast_one_hot(n, contrasts = TRUE, sparse = FALSE)
n |
A vector of character factor levels or the number of unique levels. |
contrasts |
Only the default of |
sparse |
Only the default of |
Only intended to be used in one_hot()
. Copy of hardhat:::contr_one_hot()
.
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.