[R] Only referenc copy when calling C routine?

Liaw, Andy andy_liaw at merck.com
Mon Apr 12 03:25:13 CEST 2004


My understanding is that if DUP=FALSE, no copying is done in either
direction.

If you want to avoid copying, the .Call interface is probably more suitable,
as you pass the actual R objects to the C function.  I'm not familiar with
that, though.

Andy

> From: Shin, Daehyok [mailto:sdhyok at email.unc.edu] 
> 
> Thanks, Andy.
> Let me ask a little more about the DUP argument.
> In the manual, I can see that only reference copy happens 
> when passing an
> array,
> if DUP=FALSE. Then, what happens when returning it in a list, 
> if DUP=FALSE?
> Another reference copy, or deep copy?
> 
> I am trying to implement a dynamic modeling system in R,
> where some C functions should be called more than 1000 times 
> with arguments
> of huge arrays.
> So, the issue is important for better performance.
> Thanks again,
> 
> Daehyok Shin
> 
> 
>




More information about the R-help mailing list