[Rcpp-devel] suggested revision to module vingette

romain at r-enthusiasts.com romain at r-enthusiasts.com
Wed Mar 14 12:31:25 CET 2012


Thanks. 

I'm not home tonight, i can pick it up tomorrow if nobody beats me to it. 

Romain


Le 14 mars 2012 à 12:20, Glenn Lawyer <lawyer at mpi-inf.mpg.de> a écrit :

> 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 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
> 
> <Rcpp-modules.Rnw>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120314/66c08caf/attachment.html>


More information about the Rcpp-devel mailing list