kaneplusplus / bigmemory

126 stars 24 forks source link

object of type 'S4' is not subsettable when using dim names for subsetting #79

Closed mlist closed 7 years ago

mlist commented 7 years ago

Hi,

the newest version of the bigmemory package on CRAN (4.5.28) introduced an issue. big.matrix used to support subsetting by dim names, e.g. row and column names. Now this leads to the error: object of type S4 not subsettable

Example:

test_big_matrix <- big.matrix(nrow = 5, ncol = 5, 
                              dimnames = list(
                                  c("A", "B", "C", "D", "E"), 
                                  c("F", "G", "H", "I", "J")))
test_big_matrix[,] <- 0 #works
test_big_matrix[c("A", "D"), c("H", "J")] <- 1 #used to work

I also tried if setting this option helps but it did not:

$bigmemory.allow.dimnames
[1] TRUE
privefl commented 7 years ago

Maybe the same problem as in https://github.com/kaneplusplus/bigmemory/issues/77

mlist commented 7 years ago

Yeah I believe this one has the same cause but the bugfix that was implemented works only for logical subsetting, right?

kaneplusplus commented 7 years ago

I think @mlist is correct, this is a bug. I've added the example to our unit test. I'll try to get to it in the next few days.

@privel I think it is related to #77. At some point, we lost some assignment capabilities.

kaneplusplus commented 7 years ago

@mlist @privefl OK, I think it's fixed. If I don't hear about any more problems, I'll upload to CRAN this weekend.