Oliver
2011-Jun-03 08:58 UTC
[R] C-side: Applying a function (given as param) to data (given as param)
Hello, I'm implementing a package (C-extension), where one function gets data and a function that needs to be applied to the data. I want to apply the function to (parts of) the data on the C-side. 1) how do I apply a function (given via SEXP) to data 2) how do I select parts of the data? Comment on 2: I want to implement a moving/rolling/running apply on the data, so I want to select a data window. How can this be done, and how can it be done efficiently? For example on page 101 of "Writing R extensions" there was a trick on how to use REAL on the result, before using it in a loop. Can this be used for efficiency reasons in general? What do these macros do? Do they convert data or cast datatypes? Ciao, Oliver
Possibly Parallel Threads
- C-Side: Applying a function (given as param) to data (given as param)
- Arguments of R- and C-side of internal functions
- FW: Passing lists from R to C, extracting elements, and sending lists back again
- How to seed the R random number generator in C (standalone) with an instance of .Random.seed
- Sending lists using .C