[R] Export a function from RCPP in R of type double

arvanitis sterpi23 at otenet.gr
Thu Jun 2 10:27:42 CEST 2011


Hello to everyone

I have written a small c++ function of type double function(double,double);
and i want to export it in R using RCPP. After some trials i have realized
that the only way i could do it working is to declare the function as void
function (double x, double y, double result) and pass the result with RCPP
Can you please tell me if this is the only way out?
And if this is the case how I can implement a function with is recurence
property eg a Factorial funtion
int factorial (int a){ a=factorial(a-1);}

tnks in advance for your help

--
View this message in context: http://r.789695.n4.nabble.com/Export-a-function-from-RCPP-in-R-of-type-double-tp3567793p3567793.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list