> x <- 1:500000
> tracemem(x)
[1] "<0x7fb1eab6e010>"
3/n
z <- 1:100000000
> tracemem(z)
[1] "<0x7f232de61010>"
> z[3] <- 8
tracemem[0x7f232de61010 -> 0x7f22fe370010]:
This can be very costly in code speed. R tries to avoid it, but keep this in mind. 12/n
> w <- 1:500000
> object.size(w)
2000048 bytes
> w <- c(1:499999,8)
> object.size(w)
4000048 bytes
14/n