Transform a data frame
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.