[R] read.matrix.csr bug (e1071)?

David Meyer david.meyer at wu-wien.ac.at
Sun Jan 30 00:08:09 CET 2005


This is a bug, thanks for pointing this out.

Fixed for the next release of e1071.

David

-----------------


Hello,

I would like to read and write sparse matrices using the
functions write.matrix.csr() and read.matrix.csr()
of the package e1071. Writing is OK but reading back the
matrix fails:

	x <- rnorm(100)
	m <- matrix(x, 10)
	m[m < 0.5] <- 0
	m.csr <- as.matrix.csr(m)
	write.matrix.csr(m, "sparse.dat")
	read.matrix("sparse.dat")

	Error in initialize(value, ...) : Can't use object of class "integer"
in new():  Class "matrix.csr" does not extend that class

Is something wrong with the code above or it must be
considered as a bug?

Best regards,

Peter




More information about the R-help mailing list