Skip to content

switch from model.matrix to sparseMMFromMatrix #4

@josherrickson

Description

@josherrickson

See comments on 283e156.

To replace mlm.R:101-102's use of model.matrix with SparseMMFromMatrix, which currently lives in the clusters branch of RItools.

The following code almost works, though nt or nc will have the wrong length if the optmatch object is manually manipulated (e.g. this test). I believe there's a bug in either SparseMMFromMatrix or something with matrix.csr ops, which I will crosspost to RItools about.

sparseMM <- SparseMMFromFactor(theMatch)
nt.csr <- t(as.matrix.csr(z))%*%sparseMM
nt <- attr(nt.csr, "ra")[order(attr(nt.csr, "ja"))]
nc.csr <- t(as.matrix.csr(!z))%*%sparseMM
nc <- attr(nc.csr, "ra")[order(attr(nc.csr, "ja"))]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions