Displaying 2 results from an estimated 2 matches for "my_innocent_function".
2020 Jan 09
0
Get memory address of an R data frame
On 09. 01. 20 15:41, lille stor wrote:
> I believe this could be done without creating side effects (e.g.
> crash) as we are just talking about changing values.
that is exactly the issue that my last two points warn about. Example:
a <- mtcars
.Call("my_innocent_function", a)
Would you expect that mtcars data.frame would be altered after this code
is executed? What if some existing code relies on mtcars always
containing the same data, which is a perfectly valid assumption given R
specification.
If what you are trying to do is to have mutable data frame,...
2020 Jan 09
6
Get memory address of an R data frame
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 a parameter.
The question: how can we get the memory address of the R data frame?
Thank you!
L.