Bioconductor / DelayedArray

A unified framework for working transparently with on-disk and in-memory array-like datasets
https://bioconductor.org/packages/DelayedArray
24 stars 9 forks source link

DelayedArray subsetting via lapply doesn't work #97

Open LTLA opened 2 years ago

LTLA commented 2 years ago

On DelayedArray 0.19.4:

x <- list(matrix(runif(100), 10, 10))
lapply(x, "[", i=1:5, j=1:2, drop=FALSE)
## [[1]]
##           [,1]       [,2]
## [1,] 0.5664114 0.89343894
## [2,] 0.9693973 0.07918907
## [3,] 0.1310845 0.20746916
## [4,] 0.6174420 0.48100379
## [5,] 0.5324374 0.82014878

library(DelayedArray)
y <- list(DelayedArray(x[[1]]))
lapply(y, "[", i=1:5, j=1:2, drop=FALSE)
## Error in eval(subscript, envir = eframe, enclos = eframe) : 
##   '...' used in an incorrect context

Not 100% sure what's happening here, just that there's some voodoo stuff going on with sys.call().