This is a new feature release, and we are very exciting about the
changes, notably Rcpp attributes which make using C++ from R even
easier than inline (see below as well as the
vignette for details and first examples), the extensions to Rcpp
modules (see below) and more as for example new Rcpp sugar
functions, a new error output device syncing to R, and a new namespace
for the statistical functions from
entry for 0.10.0 is below; more details are in the ChangeLog file in the package and on the
Rcpp Changelog page.
Changes in Rcpp version 0.10.0 (2012-11-13)
Support for C++11 style attributes (embedded in comments) to enable use of C++ within interactive sessions and to automatically generate module declarations for packages:
Rcpp::export attribute to export a C++ function to R
sourceCpp()function to source exported functions from a file
evalCpp()functions for inline declarations and execution
compileAttribtes()function to generate Rcpp modules from exported functions within a package
Rcpp::depends attribute for specifying additional build dependencies for
Rcpp::interfaces attribute to specify the external bindings
compileAttributes()should generate (defaults to R-only but a C++ include file using R_GetCCallable can also be generated)
New vignette “Rcpp-attribute”
Rcpp modules feature set has been expanded:
Functions and methods can now return objects from classes that are exposed through modules. This uses the make_new_object template internally. This feature requires that some class traits are declared to indicate Rcpp’s
assystem that these classes are covered by modules. The macro RCPP_EXPOSED_CLASS and RCPP_EXPOSED_CLASS_NODECL can be used to declared these type traits.
Classes exposed through modules can also be used as parameters of exposed functions or methods.
Exposed classes can declare factories with “.factory”. A factory is a c++ function that returns a pointer to the target class. It is assumed that these objects are allocated with new on the factory. On the R side, factories are called just like other constructors, with the “new” function. This feature allows an alternative way to construct objects.
“converter” can be used to declare a way to convert an object of a type to another type. This gets translated to the appropriate “as” method on the R side.
Inheritance. A class can now declare that it inherits from another class with the .derives
( “Parent” ) notation. As a result the exposed class gains methods and properties (fields) from its parent class.
New sugar functions:
which_minimplements which.min. Traversing the sugar expression and returning the index of the first time the minimum value is found.
uniqueuses unordered_set to find unique values. In particular, the version for CharacterVector is found to be more efficient than R’s version
sort_uniquecalculates unique values and then sorts them.
Improvements to output facilities:
sync()so that flushing output streams works
Rcerroutput stream (forwarding to
Provide a namespace ‘R’ for the standalone Rmath library so that Rcpp users can access those functions too; also added unit tests
Development releases sets variable RunAllRcppTests to yes to run all tests (unless it was alredy set to ‘no’); CRAN releases do not and still require setting – which helps with the desired CRAN default of less testing at the CRAN server farm.
CRANberries, you can also look at a
diff to the previous release 0.9.15.
As always, even fuller details are on the
Rcpp Changelog page and the
Rcpp page which also
leads to the downloads, the
doxygen docs and zip files of doxygen output for the standard formats.
A local directory has
source and documentation too.
Questions, comments etc should go to the
rcpp-devel mailing list
off the R-Forge page
Update: One link corrected.