Skip to content
Prev 3585 / 10988 Next

[Rcpp-devel] How do I load a rcpp module?

Hi Glenn,
On Mon, Mar 12, 2012 at 5:26 AM, Glenn Lawyer <lawyer at mpi-inf.mpg.de> wrote:
I suspect they want you to either whip the functionality you are using
to create a module from into a package of sorts (some documentation
for that is at the end of the vignette, but also in other (non
Module-specific) Rcpp vignettes).

You can alternatively try to load the shared library once you `R CMD
SHLIB` it using `dyn.load` (see ?dyn.load). You will definitely need
to have Rcpp loaded in your workspace first, though.

That may or may not work w/ modules, though ... I never tried, but:
I don't know how fair of a complaint that is ... at a minimum, I think
you should be familiar with the concepts in the "Writing R Extensions"
manual:

http://cran.r-project.org/doc/manuals/R-exts.pdf

and I don't think it's really unfair for the devs to assume that as a
starting point.

I guess you're somehow right in the sense that reading through that
requires a bit of R sophistication, but what you're trying to do w/
Rcpp is sophisticated :-)

Also, the examples using `inline` are the ones you can get away with
doing w/o having some R know-how, but once you get into the world of
trying to compile external C++ code and include it "seamlessly" into
R, you really should do a bit of h/w on the R library/package building
process (the R-exts doc above).

Hope that helps,
-steve