[Rcpp-devel] Call by reference

Nathan Kurz nate at verse.com
Wed Jul 29 23:21:27 CEST 2015


> On 29 July 2015 at 15:12, Dirk Eddelbuettel wrote:
> All this is becoming a wee bit obscure.  The focus of the list is to help
> people use Rcpp, not to navigate constraints built into the R system.

<genuine>
Yes, but for many users (well, at least RGuy and me) the impetus for
using Rcpp is to to improve performance on larger datasets.  Since R
is relatively weak in memory management, avoiding large unnecessary
copies by using Rcpp is frequently the best way to do this.
</genuine>

<joking>
Really, your misfortune was creating such a generally useful tool that
solves other people's problems.  If you'd thought ahead and designed
it to be less flexible, you wouldn't have people asking all these
uncomfortable questions about how to modify in place.
</joking>

--nate

ps.  I messed up slightly in my example.   With a 1000*1000 vector,
it's only an 8MB copy.  You need to change that to 1000*1000*1000 to
suffer an 8GB copy.


More information about the Rcpp-devel mailing list