[Rd] Huge matrices in .Call

Dominick Samperi dsamperi at DecisionSynergy.com
Thu Aug 24 18:32:11 CEST 2006


I assume that the fact that SEXP's passed through .Call
are read-only is a convention, consistent with R semantics.

This can be awkward when huge matrices are passed
as in:
newP <- .Call("myfunc", P)
because this would cause the huge matrix to be copied.

Is there any danger if I violate the convention in cases
like this and modify the SEXP matrix parameter directly,
instead of forcing R to make a copy of it every time
myfunc is called? (This seems to work in my testing.)

Thanks,
ds



More information about the R-devel mailing list