[Rcpp-devel] Extract names of functions in module

Hola Kwame Adrakey hola at aims.ac.za
Tue Mar 20 13:29:24 CET 2018

Dear all,

Can anyone give me advice/help on how to list the name(s) of all functions
defined within a module?

Here is an example of what I am trying to achieve:

Assuming that I have

inc <- '
using namespace Rcpp;

double SE(double alpha, double beta, double epsilon){
return alpha;

double EI(double alpha, double beta, double epsilon){
return beta*alpha;

function( "SE", &SE,


function( "EI", &EI,




 fx <- cxxfunction(signature(), plugin="Rcpp", include=inc)
mod <- Module("yada", getDynLib(fx)).

I can access say, the function SE by mod$SE. However, if the functions
defined within the module are not known (user defined for instance), I can
only access them by knowing their names.

I am currently using names(mod at .xData$storage), but  I have noticed that
there is a sort of randomness in its behavior, as, in some occasion, the
output is NULL.

Any help will be appreciated.

Best wishes,

Hola Kwame ADRAKEY
Research Associate
University of Cambridge ( www.c <http://www.hw.ac.uk>am.ac.uk)
Department of Plant Sciences
Epidemiology and Modeling group
Cambridge   CB2 3EA    UK
Direct tel :
Cellphone :07712254353
hA411 at cam.ac.uk <hola at aims.ac.za>
<http://www.hw.ac.uk>hola at aims.ac.za

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

More information about the Rcpp-devel mailing list