From h.wickham at gmail.com  Fri Nov  9 14:00:46 2012
From: h.wickham at gmail.com (Hadley Wickham)
Date: Fri, 9 Nov 2012 07:00:46 -0600
Subject: [Rd] built-in NAMED(obj) from within R
In-Reply-To: <loom.20121109T125440-643@post.gmane.org>
References: <509C7CD1.7080105@gmail.com>
	<loom.20121109T125440-643@post.gmane.org>
Message-ID: <CABdHhvFMGGU_jFSeYq8i4C1vH9=poJ21PJv1eO=S0wFm76e=uQ@mail.gmail.com>

>> The goal is to ascertain whether a copy of an object has been made.
>
> Then :
>
>     ?tracemem
>
> One demonstration of using both together is here :
>
>     http://stackoverflow.com/a/10312843/403310

Note that tracemem detects duplications (in a technical R sense), not
copies - i.e.

x <- 1:10
tracemem(x)
x[11] <- 11L

although all the individual elements are copied, the vector is not
duplicated.  This confused me at first, so I thought I'd point it out.

Hadley

-- 
RStudio / Rice University
http://had.co.nz/



[Rd] built-in NAMED(obj) from within R
Hadley Wickham