Converts a data frame with categorical and numeric columns into a numeric matrix, using one-hot encoding for categorical variables.
Examples
df <- data.frame(a = c(1, 2), b = c("yes", "no"))
convert_to_numeric_matrix(df)
#> a b_no b_yes
#> [1,] 1 0 1
#> [2,] 2 1 0