Re: [Rcpp-devel] Struggling with cppFunction() and clusterExport()

2013-09-27 Thread Dirk Eddelbuettel
On 27 September 2013 at 11:28, Romain Francois wrote: | It might be worth handling this internally. The object could carry with | it its definition and compile itself if the pointer is the null pointer, | which is what you get apparently. | | Unless things have evolved in R, there is no way to

Re: [Rcpp-devel] Struggling with cppFunction() and clusterExport()

2013-09-27 Thread Romain Francois
Le 27/09/13 00:20, Matteo Fasiolo a écrit : Thanks a lot for your replies, I will go for the package solution, given that I'm organizing all my code in a package in any case. Matteo That's the preferred approach. It might now however give you the flexibility of passing arbitrary functions at

Re: [Rcpp-devel] Struggling with cppFunction() and clusterExport()

2013-09-26 Thread Matteo Fasiolo
Thanks a lot for your replies, I will go for the package solution, given that I'm organizing all my code in a package in any case. Matteo On Thu, Sep 26, 2013 at 6:15 PM, Romain Francois wrote: > The usual way is to put the function in a package and load the package. > > Otherwise, you could do

Re: [Rcpp-devel] Struggling with cppFunction() and clusterExport()

2013-09-26 Thread Romain Francois
The usual way is to put the function in a package and load the package. Otherwise, you could do something along these lines auto_function <- function( code, ... ){ dots <- list(code, ...) function(...){ do.call( cppFunction, dots )( ... ) } } This way the function knows how

Re: [Rcpp-devel] Struggling with cppFunction() and clusterExport()

2013-09-26 Thread Dirk Eddelbuettel
On 26 September 2013 at 17:57, Matteo Fasiolo wrote: | Given that I have just started parallelizing my algorithms in this | way, any suggestion/criticism about the overall approach is  | more then welcome! One solution (which I favour) is to organize your in packages, and to have each node load t