Iirc we have mapply2 and mapply3. 

Otherwise you can make Foo a helper class instead of a function. And you embed 
the 3 variables in your class. 



Le 10 mai 2013 à 17:40, Julien Duvanel <julien.duva...@epfl.ch> a écrit :

> Hello again,
> 
> I hope I don't disturb you too much. I have again a small question. I haven't 
> seen the answer on your vignette, maybe this is not possible. Here's what I 
> would like to do :
> 
> double Foo(double x, double a1, double a2) {
>       return f(x,a1,a2);
> }
> 
> NumericVector myVec;
> 
> sapply(myVec, Foo(  ……, a1, a2)); // This is the line not working
> 
> In every example I saw, Foo (in the example, it's sometimes square) could 
> only have one parameter (and in my case I have many parameters).
> 
> Is it possible ? Am I missing something ?
> 
> Thank you very much (again) for your time,
> 
> Have a nice evening/week-end,
> 
> Julien
> 
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel@lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to