[Rcpp-devel] rollapply
Dirk Eddelbuettel
edd at debian.org
Wed Feb 26 17:35:51 CET 2014
On 26 February 2014 at 16:23, Hideyoshi Maeda wrote:
| Hi Rcpp devel list,
|
| One of the functions I like to use is zoo’s rollapply() function. However sometimes this can be slow as it is basically a long loop using mapply.
|
| Given how fast loops are in C++ this seems like this would be the perfect thing to covert into C++, BUT, one of the benefits of rollapply, is that it is flexible and you can put in any R custom function you like. I think there are some functionality in Rcpp that allow you to carry out custom R functions, but not sure what it is or if it would be helpful as you might have to recursively keep calling R each time it need the custom function in the loop.
|
| So I guess my question is 1) is there an existing implementation that has converted rollapply to C++ and 2) if not, then given the desired flexibility of using custom functions in rollapply, would converting it into C++ code be worthwhile? 3) if it would be worthwhile, then what should I be researching to be able to get custom functions into Rcpp/C++?
Have you looked at RcppRoll yet? See
http://cran.r-project.org/web/packages/RcppRoll/index.html
Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
More information about the Rcpp-devel
mailing list