SCM

[#6580] sparse model.Matrix doesn't produce correct names for terms with > 1 df

Date:
2018-05-02 20:10
Priority:
3
State:
Open
Submitted by:
Vitalie Spinu (spinuvit)
Assigned to:
Nobody (None)
Hardware:
PC
Product:
None
Operating System:
Linux
Component:
None
Version:
None
Severity:
None
Resolution:
None
URL:
Summary:
sparse model.Matrix doesn't produce correct names for terms with > 1 df

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)

Comments:

No Comments Have Been Posted

Attached Files:

Changes

No Changes Have Been Made to This Item

Thanks to:
Vienna University of Economics and Business Powered By FusionForge