Converts a terrain table to a numeric predictor matrix and optional response vector.
Examples
df <- data.frame(y = c(0, 1, 0), slope = c(1, 2, 3), bpi = c(0.2, 0.1, 0.4))
prepare_model_matrix(df, response = "y")
#> $x
#> slope bpi
#> [1,] 1 0.2
#> [2,] 2 0.1
#> [3,] 3 0.4
#>
#> $y
#> [1] 0 1 0
#>
#> $data
#> y slope bpi
#> 1 0 1 0.2
#> 2 1 2 0.1
#> 3 0 3 0.4
#>
