[Rcpp-devel] Question about variadic argument "..." in Rcpp

SHEN Fei shenfei361 at gmail.com
Wed Jul 18 04:29:12 CEST 2012


Dear all,

I got some problems with the variadic argument "..." in Rcpp.

Suppose i have a R function f:
f <- function(x,...)
{
    blabla
}

In another R function, i want to pass this f as an argument to a C++
function, along with all its own parameters, i.e. x and the "...".

I found a method that applies  Rcpp Module to treat the various argument
... as _["..."]. But i'm still very confused. Would you please give me an
example to show how to use Rcpp to do the function transformation,
especially when the "..." argument is used.

And since the background of my program is a little special, i will also
call R functions in the C++ function that i pass f to.

I knew that i can use Rcpp to call C++ functions in R, and use RInside to
call R functions in C++. But can i use them both at the same time?
I've tried "R -> C++ -> R" with only Rcpp and that worked. But can i use
Rcpp at "R -> C++" stage and use RInside at "C++ -> R" stage in one
program? I'm still very confuse with the packages usage. Btw, i use
Rcpp.package.skeleton() to create my package and i add RInside in the
DESCRIPTION file, but it seems to be useless.

I'll very appreciate if you could give me another example to show how to
pass "..." argument to a R function in the C++ environment.

Thank you very much!

-- 
SHEN Fei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120718/e69eeba1/attachment.html>


More information about the Rcpp-devel mailing list