RE: [R] Deep copy in R

2004-04-06 Thread Thomas Lumley
On Mon, 5 Apr 2004, Shin, Daehyok wrote: > Hm. Smarter than I expected. > But, any special reason why the 6th line clones another vector? > To me, just reference copy seems to be enough for the purpose. > > 6 xf = date.frame(x=x) > You would have to look at the code for data.frame to see this, bu

RE: [R] Deep copy in R

2004-04-05 Thread Shin, Daehyok
Of Thomas Lumley > Sent: Monday, April 05, 2004 PM 5:18 > To: Shin, Daehyok > Cc: R, Help > Subject: Re: [R] Deep copy in R > > > On Mon, 5 Apr 2004, Shin, Daehyok wrote: > > > I am handling spatial data of huge volumes, > > so sensitive to the silent duplication of

Re: [R] Deep copy in R

2004-04-05 Thread Thomas Lumley
On Mon, 5 Apr 2004, Shin, Daehyok wrote: > I am handling spatial data of huge volumes, > so sensitive to the silent duplication of data in script programs. > In the following R program, exactly when is the vector data deeply copied? > Thanks in advance. > > 1 v <- 1:1 > 2 z <- f(v) > > ---

[R] Deep copy in R

2004-04-05 Thread Shin, Daehyok
I am handling spatial data of huge volumes, so sensitive to the silent duplication of data in script programs. In the following R program, exactly when is the vector data deeply copied? Thanks in advance. 1 v <- 1:1 2 z <- f(v) - function f -- 3 f <- function(x) { 4 y = x