as_model_matrix {bigutilsr} | 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)