[Rcpp-devel] Rcpp::Function

Dirk Eddelbuettel edd at debian.org
Tue Jan 5 00:22:04 CET 2010


On 4 January 2010 at 23:59, Romain François wrote:
| Just to give an example of Rcpp::Function :
| 
|  > funx <- cfunction(signature(), '
| + Environment stats_namespace = Environment::namespace_env("stats") ;
| + Function rnorm( stats_namespace.get("rnorm") ) ;
| + return rnorm( 10, Named("sd", 100) ) ;
| + ', Rcpp=TRUE, verbose=FALSE, includes = "using namespace Rcpp;" )
|  >
|  > funx()
|   [1]   19.4633261 -121.6885863   34.7072963   -7.1155573  -33.4987573
|   [6]  -73.0344024  -58.9558195   -0.3289519   81.7164016  151.8835010
| 
| 
| One thing we are going to have to do at some point is some examples 
| somewhere. We have lots of unit tests, but maybe it would be worth 
| having some C++ only examples (without the inline trick) to show the API.

Yup. We are already beyond the point of an R Journal or JSS article and is
narrowing a short book, and it only gets worse.  Tell me when you code up
Time::Machine and we take a timeout and document all this properly.

Dirk

-- 
Three out of two people have difficulties with fractions.


More information about the Rcpp-devel mailing list