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

Jeszenszky Peter jeszy at inf.unideb.hu
Fri Jan 28 16:22:46 CET 2005


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