[Rcpp-devel] Calling an internal do_* C level function

Romain Francois romain at r-enthusiasts.com
Mon Oct 14 19:41:25 CEST 2013


Le 14/10/13 19:33, Mark Fredrickson a écrit :
> Hello,
>
> Does anyone have an example of calling into C level functions that would
> be called with .Internal() in R?
>
> Specifically, I'd like to call do_rank, as defined in:
>
> http://svn.r-project.org/R/trunk/src/main/sort.c
>
> These functions have an unusual signature, and I'm not sure what
> headers/linker directives I would need to include to get access to this
> function.
>
> I am aware that I could call the R level rank() function, but I'm trying
> to avoid the performance penalty.
>
> Thanks,
> -Mark

Most of them are hidden. You can't call them. For example:

SEXP attribute_hidden do_rank(SEXP call, SEXP op, SEXP args, SEXP rho)

The attribute_hidden hides the function. If you want this function to be 
available as part of the R api, you need to negociate that with the R 
core team.

In similar situations, people have copied the code over to their 
project. It might be appropriate for you.

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30



More information about the Rcpp-devel mailing list