[Rd] Accessing i'th element of a vector without using a macro
saptarshi.guha at gmail.com
Mon May 20 19:35:35 CEST 2013
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
If such a function doesn't exist in libR.so, then i can write one.
On Mon, May 20, 2013 at 10:03 AM, Gabriel Becker <gmbecker at ucdavis.edu> wrote:
> 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 your usecase? What exactly is it
> that you want to do?
> On Mon, May 20, 2013 at 9:56 AM, Saptarshi Guha <saptarshi.guha at gmail.com>
>> I have a double vector, x. I can access the i'th element as
>> 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
>> R-devel at r-project.org mailing list
> Gabriel Becker
> Graduate Student
> Statistics Department
> University of California, Davis
More information about the R-devel