[Rcpp-devel] suggested revision to module vingette

Glenn Lawyer lawyer at mpi-inf.mpg.de
Wed Mar 14 12:20:22 CET 2012


Not sure if this is the right place to send it or not, but 
according to the Rcpp homepage

"We now have a mailing list 
<http://lists.r-forge.r-project.org/pipermail/rcpp-devel/> for 
discussions around Rcpp. If you have ideas or suggested changes, 
send an email there."

I suggest modifying inst/doc/Rcpp-modules/Rcpp-modules.Rnw in two 
places, as indicated in the text below and in the attached version 
of Rcpp-modules.Rnw

The motivation for the change is that the R code as shown in the 
vingette does not load the compiled code, and thus fails. It is 
not otherwise clear from the vingette how to load compiled code. 
It is also not clear from the unit tests, as these rely on inline 
compilation i.e.
    fx <- cxxfunction( signature(), "" , include = inc, plugin = 
"Rcpp" )
    mod <- Module( "yada", getDynLib(fx) )

###################################
First suggested change
###################################
305,306d304
< For this brief example, assume the code has been compiled as 
``test.so'' using R CMD SHLIB. In general, however, we recommend 
the use of packages.
<
312c310
< mod <- Module( "mod", PACKAGE=dyn.load( "test.so" ) )
---
 > mod <- Module( "mod" )


###################################
Second suggested change -- please make sure the R code is correct, 
and the comments should be removed
###################################

360c358
< Assuming this code is contained in package myPackage, then the 
functions are available in \proglang{R} via:
---
 > and can then be used from \proglang{R}:
364,365c362,363
< require( myPackage )       ## is this sufficient??
< yada <- Module( "yada" ) ## does this need to indicate the package??
---
 >
 > yada <- Module( "yada" )

###################################





-- 

-----------------------------------
It is difficult to find a black cat in a dark room,
especially if there is no cat.
   -- Chinese proverb

   Dr. Glenn Lawyer
   +352 661 967 244
   Max-Planck-Institut für Informatik
   Computational Biology and Applied Algorithmics
   Campus E1 4
   66123 Saarbrücken, Germany
   http://bioinf.mpi-inf.mpg.de/~lawyer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120314/770acfec/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Rcpp-modules.Rnw
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120314/770acfec/attachment-0001.ksh>


More information about the Rcpp-devel mailing list