covar_from_df | R Documentation |
Transform a data frame to a numeric matrix by one-hot encoding factors. The last factor value is always omitted to prevent having a singular matrix when adding a column of 1s (intercept) in models.
covar_from_df(df)
df |
A data frame. |
A numeric matrix.
mat <- covar_from_df(iris)
head(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.