[R] deep copy?

Whit Armstrong armstrong.whit at gmail.com
Sat Apr 14 02:32:18 CEST 2012


Is putting a variable into a list a deep copy (and is tracemem the
correct way to confirm)?

warmstrong at krypton:~/dvl/R.packages$ R
> x <- rnorm(1000)
> tracemem(x)
[1] "<0x3214c90>"
> x.list <- list(x.in.list=x)
tracemem[0x3214c90 -> 0x2af0a20]:
>

Is it possible to put a variable into a list without causing a deep
copy (i.e. if you _really_ want the objects to share the same
underlying memory)?

-Whit



More information about the R-help mailing list