Search the entire project
This project's trackers
This project's forums
This project's news
Matrix Methods and Classes
[#6616] Matrix::Matrix does not retain the correct rownames
Robrecht Cannoodt (
Martin Maechler (mmaechler)
Matrix::Matrix does not retain the correct rownames
The bug is simple to reproduce:
> m <- matrix(1, dimnames = list("a", "b"))
> Matrix::Matrix(m, sparse = TRUE)
1 x 1 sparse Matrix of class "dsCMatrix"
I encountered this problem with Matrix v 1.2-15.
Date: 2019-03-11 14:23
Your guess is correct: The bug is in R's isSymmetric(.) which is wrong here
[only for 1x1 matrices with asymmetric dimnames].
Hence a bug in R -- which I now have fixed in the R sources.
But "of course" it's still present in R 3.5.3 which was released today.
As this is a border case, I don't think we should establish a workaround (of the R bug) in Matrix.
Date: 2019-03-07 18:16
I guess the problem is that isSymmetric(m) is TRUE. I would argue that the above scenario is undesired though, because it results in unexpected errors in certain edge cases.