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
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
> 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
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 in 1:5)
{
data[x] <- as.integer(0)
}
if (add == addr