Re: [R] memory use of copies

2014-01-29 Thread Philippe GROSJEAN
For the last case with the list: x - 1:2; y = list(x)[rep(1, 4)] .Internal(inspect(y)) @102bbe090 19 VECSXP g0c3 [MARK,NAM(2)] (len=4, tl=0) @106119628 13 INTSXP g0c1 [MARK] (len=2, tl=0) 1,2 @106119628 13 INTSXP g0c1 [MARK] (len=2, tl=0) 1,2 @106119628 13 INTSXP g0c1 [MARK] (len=2, tl=0)

Re: [R] memory use of copies

2014-01-28 Thread Ross Boylan
Thank you for a very thorough analysis. It seems whether or not an operation makes a full copy really depends on the specific operation, and that it is not safe to assume that because I know something is unchanged there will be no copy. For example, in your last case only one element of a list

Re: [R] memory use of copies

2014-01-27 Thread Martin Morgan
Hi Ross -- On 01/23/2014 05:53 PM, Ross Boylan wrote: [Apologies if a duplicate; we are having mail problems.] I am trying to understand the circumstances under which R makes a copy of an object, as opposed to simply referring to it. I'm talking about what goes on under the hood, not the user

[R] memory use of copies

2014-01-23 Thread Ross Boylan
[Apologies if a duplicate; we are having mail problems.] I am trying to understand the circumstances under which R makes a copy of an object, as opposed to simply referring to it. I'm talking about what goes on under the hood, not the user semantics. I'm doing things that take a lot of memory,