[R] Only referenc copy when calling C routine?
Liaw, Andy
andy_liaw at merck.com
Mon Apr 12 03:43:58 CEST 2004
For me it's just a matter of getting my hands dirty, I guess. For whatever
reason I seem to have a mental block about the PROTECT/UNPROTECT business...
Best,
Andy
> From: Duncan Murdoch [mailto:dmurdoch at pair.com]
>
> On Sun, 11 Apr 2004 21:25:13 -0400, you wrote:
>
> >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.
>
> If you're using C, .Call (or .External) is not really very hard to
> use. You want to take a look at the examples in the Writing
> Extensions manual, and probably in one or two simple packages.
>
> The big limitation with .Call is that it is really only practical with
> C or C++ (because you definitely need to use the R header files),
> whereas .C and .Fortran make calls that just about any language can
> handle.
>
> Duncan Murdoch
>
>
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments,...{{dropped}}
More information about the R-help
mailing list