Detailed description |
For sparse output colnames are wrong:
> colnames(model.Matrix(speed ~ ns(dist, 4) + poly(dist, 2), data = cars, sparse = T))
[1] "(Intercept)" "1" "2" "3" "4"
[6] "1" "2"
> colnames(model.Matrix(speed ~ ns(dist, 4) + poly(dist, 2), data = cars, sparse = F))
[1] "(Intercept)" "ns(dist, 4)1" "ns(dist, 4)2" "ns(dist, 4)3"
[5] "ns(dist, 4)4" "poly(dist, 2)1" "poly(dist, 2)2"
This is with MatrixModels * 0.4-1 2015-08-22 CRAN (R 3.4.4)
|
|