[R-sig-hpc] assignment of values to ff objects.

Benilton Carvalho beniltoncarvalho at gmail.com
Tue Apr 27 23:50:36 CEST 2010


Hello guys,

this is (no longer) a question, but I'm posting this here (in
agreement with Jens) as others may benefit.

At some point, I had the impression that one assignment of the form

ffObject[idx, ] <- value

was triggering a problem (spike in memory usage) within my code. The
problem was something else, but here's the reply I got from Jens
(off-list communication) when I asked if something weird could happen
from such assignment:

"what happens here exactly depends:

you select the row via idx, if this is too long: not good
you do not select columns, if there are many: not good
if value has exactly the size of  SelectedRows x AllColumns nothing
unexpected should happen.
if value is smaller in rows or columns, some recycling needs to be done.
We try to do this recycling in ff''s C-code without actually
increasing the size of 'value', however, under some circumstances
(notably non-standard dimorder or virtual windowing) we might first
create in R a 'value' of the approbriate size (then permute accoring
to dimorder) and then assign. In this case, R's memory can grow during
the assignment."

Cheers,
benilton



More information about the R-sig-hpc mailing list