[R] Pass By Value Questions

Jens Oehlschlägel jens.oehlschlaegel at truecluster.com
Fri Aug 20 14:05:31 CEST 2010


Jeff, 
R has 'environments' as a general mechanism to pass around objects by reference. However, that does not help with most functions like 'apply' which take arguments other than environments. 
> I'm familiar with FF and BigMemory, but are there any packages/tricks> which allow for passing such objects by reference without having to code> in C? 
With ff (and I assume with bigmemory as well) you can pass around objects by reference without C-coding.To be more precise with regard to ff: atomic ff objects have 'hybrid copying semantics', which means that two references to an ff object will share the data and SOME features (like the 'length') while OTHER features (like 'dim') are copied on modify (see 'vt' for an powerful application of this concept). You might want to have a look at 'ffapply' and friends and at 'chunk'.

HTH

Jens Oehlschlägel



More information about the R-help mailing list