Skip to content
Prev 1889 / 2152 Next

Trouble with subset.ff

Jens,

I tested and implemented your code - works like a charm!

Many thanks
Christian


-----Urspr?ngliche Nachricht-----
Von: "Dr. Jens Oehlschl?gel" [mailto:joehl at web.de] 
Gesendet: Donnerstag, 1. Mai 2014 00:03
An: Kamenik Christian ASTRA
Cc: r-sig-hpc at r-project.org
Betreff: Re: [R-sig-hpc] Trouble with subset.ff

Christian,

1. package ff has no subset method for ff or ffdf. ffbase has, but that is creating a physical copy of the subsetted  object on disk, which is expensive, is that what you want?

2. indexing with logical ff is neither implemented nor said to be implemented, only indexing with integer ff

3. the recommended way of doing logical indexing of ff or ffdf is using bit vectors. For converting your logical ff to bit you can use
as.bit(logical_ff[]) or a chunked version thereof, consider

l <- sample(c(FALSE,TRUE), 100, TRUE)
f <- as.ff(l)
b <- bit(length(f))
for (i in chunk(f)){
  b[i] <- f[i]
}
identical(as.logical(b), l)
f[b]


Jens

Am 23.04.2014 14:54, schrieb christian.kamenik at astra.admin.ch: