[Rd] Calling an array in a struct in C to R
tjardie at gmail.com
Wed Jun 19 16:14:40 CEST 2013
Although I'm a quite experienced R user and know my ways in C, I stumbled
upon a problem I don't know how to solve. Therefore, I hope someone can
provide me with the information or pointers I need in order to understand
the way in which the communication between R and C occurs. I have the
following C code which basicallly reflects what I want:
examplefunction(&a); /*fills and dynamically grows a->array*/
Now I would want to return a.array or a->array to R. According to the R
manuals, the compiled C code should not return anything except through its
arguments. The problem here is, I have a dynamically growing array, and I
have no idea what to pass on to C from R in order to let that work.
The word 'should' indicates that the compiled code may return something in
special circumstances, but I have no idea how to get a.array in R.
So my question is simply this: How on earth do I get the information in the
float array 'a.array' in R? Is it even possible or should I rewrite my C
code using Call in R?
Another, not preferred, options is to pre-allocate the array/vector in R on
a fixed (large-enough) size? Or do I miss something here?
View this message in context: http://r.789695.n4.nabble.com/Calling-an-array-in-a-struct-in-C-to-R-tp4669884.html
Sent from the R devel mailing list archive at Nabble.com.
More information about the R-devel