Just following up on this since the associated bug report just got
closed (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17329 )
because my original bug report was incomplete, and did not include
sessionInfo() or LC_CTYPE.
Admittedly, my original bug report was a little confused. I have s
A simpler version with annotation:
library(pryr)
data <- 1:5 # new allocation, referenced from one variable
add <- address(data)
data[1] <- 6L# only one reference; don't need to duplicate
add == address(data) # TRUE
print(data) # inside the print call the local vari
Hi David,
Thanks for the correction concerning the "else" issue.
Taking your code and removing some lines (to increase readability):
library(pryr)
data <- array(dim = c(5))
for(x in 1:5)
{
data[x] <- as.integer(x * 2)
}
#print(data)
add = address(data)
for(x in 1:5)
{
data[x] <-
> 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