[Rd] Get memory address of an R data frame

2020-01-09 Thread lille stor
Hello, I would like for my C function to be able to manipulate some values stored in an R data frame. To achieve this, a need the (real) memory address where the R data frame stores its data (hopefully in a contiguous way). Then, from R, I call the C function and passing this memory address as

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

[Rd] Array changing address unexpectedly

2017-11-12 Thread lille stor
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

[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

[Rd] R and Visual Studio

2017-09-19 Thread lille stor
Hi,   I am trying to build R using Visual Studio 2010 but without success. My question is if it possible build R with this compiler anyway?   If not, could someone please tell how to link one's C code against both the static and shared libraries of R for Windows (that comes from the official web

[Rd] Change of variable address due to GC

2017-09-08 Thread lille stor
Hi,   I would like to know if the Garbage Collector (GC) changes the address of a variable in R. In other words, assuming the following code:         library(pryr)         x <- 1:1024         addr <- address(x)  # save address of variable "x" in "addr"       .        .