Closed brgew closed 1 year ago
I believe this is the intended default behavior for the as
function in R -- when given a subclass of IterableMatrix
it will strip the object down to just the fields that are present in the IterableMatrix
base class, hence losing information.
I believe if you don't want this behavior you can instead do as(bpm1, "IterableMatrix", strict=FALSE)
which won't modify any variables that are a subclass of IterableMatrix
.
Hi Ben,
Thank you again! I apologize for bothering you...
Ever grateful, Brent
Hi Ben,
Me again. I am seeing BPCells from a different perspective suddenly. I am wondering if it makes sense to wrap our dgCMatrix instances in IterableMatrix wrappers and use the wrapped matrices in place of the dgCMatrices. I suppose it depends on having all of the expected methods. I will run some tests.
So I wondered what happens in the case that I try to wrap an IterableMatrix in an IterableMatrix using R commands like
It appears that the bpm2 lost some important information whereas I expected it to be identical to bpm1.
The Matrix package behave more in line with my expectation, for example,
Of course, I can test whether or not the input matrix is already an 'IterableMatrix' too.
Ever grateful, Brent