as_model_matrix | R Documentation |
Transform a data frame into a matrix using one hot encoding.
as_model_matrix(df, intercept = FALSE)
df |
A data frame. |
intercept |
Whether to have a column with all |
A matrix.
mat <- as_model_matrix(iris)
str(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.