Re: [Rd] Accessing i'th element of a vector without using a macro

2013-05-20 Thread Saptarshi Guha
Exactly, that is what i use. I intend to do the operation using an FFI library(i't s just a proof of concept, and there well might be performance hits) If such a function doesn't exist in libR.so, then i can write one. Regards Saptarshi On Mon, May 20, 2013 at 10:03 AM, Gabriel Becker wrote: >

Re: [Rd] Accessing i'th element of a vector without using a macro

2013-05-20 Thread Gabriel Becker
Saptarshi, When I need to repeatedly access data from a an R vector in C I typically just create a pointer to the data and just use that. double *xdat = REAL(x); xdat[i]; //repeat as necessary This is also displayed in 5.9.4 of the R extensions manual. Is there a reason this wouldn't work for y

[Rd] Accessing i'th element of a vector without using a macro

2013-05-20 Thread Saptarshi Guha
Hello, I have a double vector, x. I can access the i'th element as REAL(x)[i] Is there a function for this? I know i can write my own, but was seeing if one already exists. I did check Rinternals.h but didn't see one. Cheers Saptarshi __ R-devel@r-pr