Calling an R function using inline and Rcpp is still just as slow as original R code

Solution 1:

You are calling an R function from Rcpp.

That cannot be faster than calling the R function directly.

Your binding constraint is the function you call and not how you call it. Rcpp is not some magic R-to-C++ compiler.