Re: [Rd] Memory address of character datatype

2017-11-02 Thread peter dalgaard
I'm not really disagreeing with this, but is not the point of pryr to let you investigate internals from the R level? Building code that relies on pryr returning things with specific properties is very likely doubleplusunrecommended by pryr's author as well. In that spirit, I suppose that you

Re: [Rd] Memory address of character datatype

2017-11-02 Thread Tomas Kalibera
If you were curious about the hidden details of the memory layout in R, the best reference is the source code. In your example, you are not getting to your string because there is one more pointer in the way, "x" is a vector of strings, each string is represented by a pointer. At C level, ther

[Rd] Memory address of character datatype

2017-11-01 Thread lille stor
Hi,   To get the memory address of where the value of variable "x" (of datatype "numeric") is stored one does the following in R (in 32 bit):         library(pryr)       x <- 1024       addr <- as.numeric(address(x)) + 24    # 24 is needed to jump the variable info and point to the data itself (i