[R] dput sparseMatrix list
dwinsemius at comcast.net
Tue Jan 5 08:30:47 CET 2016
> On Jan 4, 2016, at 11:17 PM, Lietz, Haiko <Haiko.Lietz at gesis.org> wrote:
> hi all,
> when dputting a list of sparse matrices (Matrix package), the output does not contain the data but the information that the list contains sparse matrices.
> M <- sparseMatrix(i = c(2, 1), j = c(1, 2), x = c(1, 1))
> dput(M) ... works.
> dput(list(M, M)) ... does not work.
> how can I dput a list of sparse matrices?
> MM <- list(M,M)
list(<S4 object of class structure("dgCMatrix", package = "Matrix")>,
<S4 object of class structure("dgCMatrix", package = "Matrix")>)
I do get an error (clarifying the "did not work" statement), as (perhaps) did you?
Error in cat("new(\"", clx, "\"\n", file = file, sep = "") :
Perhaps the `dput` function was not configured to handle two S4 objects in a list?
> [[alternative HTML version deleted]]
Please do better next time.
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Alameda, CA, USA
More information about the R-help