Skip to content
Prev 42870 / 398506 Next

reference to objects

On Fri, 16 Jan 2004, Giampiero Salvi wrote (in reply to some unidentified
helper):
If the data are read only it is likely that R will *not* create two
copies, eg try
  a<-list(x=rnorm(1e6))
  gc()
  b<-a$x
  d<-a$x
  gc()
  b<-b+1
  d<-d+1
  gc()
This won't work any better.  get(obj1$data) will get the object, and
there's no reason to expect that it's less likely to get a copy than
simple assignment is.

	-thomas