Re: [Rd] Array changing address unexpectedly

2017-11-12 Thread luke-tierney
s it is a bit counter-intuitive? Is it something to do with some kind of lazy-evaluation mechanism R has that makes the array to be filled-up only when needed (in this case, when printing it) thus changing the array's address? Thank you once more! Sent: Sunday, November 12, 2017 at 6:0

Re: [Rd] Array changing address unexpectedly

2017-11-12 Thread lille stor
printing it) thus changing the array's address?   Thank you once more!     Sent: Sunday, November 12, 2017 at 6:02 PM From: "David Winsemius" To: "lille stor" Cc: r-devel@r-project.org Subject: Re: [Rd] Array changing address unexpectedly > On Nov 12, 2017, at 8:47 A

Re: [Rd] Array changing address unexpectedly

2017-11-12 Thread David Winsemius
> On Nov 12, 2017, at 8:47 AM, lille stor wrote: > > Hi, > > Given the following R code: > > library(pryr) > > data <- array(dim = c(5)) > > for(x in 1:5) > { > data[x] <- as.integer(x * 2) > } > > add = address(data) # save address of "data" > > for(x