[R] Is there lazy copy in R?

Peng Yu pengyu.ut at gmail.com
Tue Dec 15 16:23:46 CET 2009


On Tue, Dec 15, 2009 at 10:32 PM, hadley wickham <h.wickham at gmail.com> wrote:
>> I don't understand what these addresses mean. Would you please help me
>> understand it?
>
> Did you try reading the documentation?
>
>     When an object is traced any copying of the object by the C
>     function ‘duplicate’ or by arithmetic or mathematical operations
>     produces a message to standard output.  The message consists of
>     the string ‘tracemem’, the identifying strings for the object
>     being copied and the new object being created, and a stack trace
>     showing where the duplication occurred.  ‘retracemem()’ is used to
>     indicate that a variable should be considered a copy of a previous
>     variable (e.g. after subscripting).

"The message consists of the string ‘tracemem’, the identifying
strings for the object being copied and the new object being created,
and a stack trace showing where the duplication occurred."

I tried to read the document before I posted, but wasn't be able to
understand it, because there are multiple ways to parse it.

To make sure that I understand, I rewrite the above sentence to the
following. Is it correct?

"The message consists of the string ‘tracemem’, the string indicating
the object being copied,  the string indicating the new object being
created, and a stack trace showing where the duplication occurred."

I also didn't see a stack trace in my example. If I didn't see Martin
Morgan's post, I will still be confused.


I thought that there should be only one coping. Why there are two lines?

tracemem[0x05cf2798 -> 0x05cf2750]:
tracemem[0x05cf2750 -> 0x05ed8ba0]:




More information about the R-help mailing list