Skip to content
Prev 40413 / 63424 Next

C-Side: Applying a function (given as param) to data (given as param)

Oliver,

For an example of moving averages, take a look at the C source of the xts and TTR packages. The sources are browsable on R-forge. 

In short, REAL etc are functions to extract the data of an SEXP. They need to match the types coming in. So your C needs to check the type and branch accordingly. 

It is all in the guide as well as in working example code in R sources as well as many hundreds of package sources. You have access to it all, so spend the time just reading the sources is my recommendation.  

Best,
Jeff

Jeffrey Ryan    |    Founder    |    jeffrey.ryan at lemnica.com

www.lemnica.com
On Jun 3, 2011, at 3:19 PM, oliver <oliver at first.in-berlin.de> wrote: