Suppose I have a gigantic m*n matrix X
(that is too big to read into memory) and binary numeric vector V
with length m
. My objective is to
ffdfindexget
from ff
package is what you are looking for:
Function ffdfindexget allows to extract rows from an ffdf data.frame according to positive integer suscripts stored in an ff vector.
So in your example:
write.csv(X,"target.csv")
d <- read.csv.ffdf(file="target.csv")
i <- ff(which(V==1))
di <- ffdfindexget(d, i)