Dirk Eddelbuettel: Rcpp 0.10.0
Rcpp release 0.10.0
is now on CRAN and being uploaded to Debian.
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
new
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 R>
for the statistical functions from Rmath.h.
The complete NEWS
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)Thanks to 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 browseable 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
- 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 filecppFunction()andevalCpp()functions for inline declarations and executioncompileAttribtes()function to generate Rcpp modules from exported functions within a package- Rcpp::depends attribute for specifying additional build dependencies for
sourceCpp()- 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
wrap/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>( "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.which_maxidemuniqueuses unordered_set to find unique values. In particular, the version for CharacterVector is found to be more efficient than R's versionsort_uniquecalculates unique values and then sorts them.- Improvements to output facilities:
- Implemented
sync()so that flushing output streams works- Added
Rcerroutput stream (forwarding toREprintf)- 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.
Update: One link corrected.
I was quite unhappy with shape of our documentation for some time, but this week I finally found some time to dig deeper into conversion into something more usable.
Nowadays I'm mostly using
There's this new Windows thing that people keep
I ve spent some time thinking about how to properly audit packages for common mistakes.
As part of this problem is how to store the issues found. All the tools I care about have different output formats, and I hate the idea of writing so many adapters for all the tools into some sort of common format.
Has anyone come across this issue before? Anyone working on something similar?

Several months ago, I wrote about
There's a post
This morning, I ran again with No l, my longstanding Debian running
friend.
The goal was, this time, to explore the South-East heights of
Managua. I noticed a road that seemed to be quiet enough and not
requiring a too long transit through busy, noisy and bad smelling
highways.
So, at 06:00 we headed from the Seminole hotel to the road to Masaya
(the very large highway that goes in front ofMetrocentro). We had to
run along it for a bit less than 2km. Not the best thing but the road
was not very busy at that time.
Then, we turned right into a road heading towards a quite "classy"
neighbourhood where roads are well paved, there are sidewalks, etc, etc.
It was going up ALL TIME LONG, which is interesting as a start. This
placed is named "Lomas de Santo Domingo" in Google Maps.
We even found there the embassy of the Islamic Republic of Iran. I can
tell you, the Iran ambassador is quite living in a neat place and
probably very happy to be there..:-)
Fromthere, a very good concrete road starts to go up and up and up and
up. many many very high standard villas, with fences, guards, etc.
Strangely, there were several "For Sale" signs instead of "Se Vende".
So, I guess this is a sign that this place is mostly inhabited by
(very rich) foreigners, diplomats, etc.
This very nice road was also....climbing a lot: 180m in 3.5km, so 5.1%
average, but sometimes closer to 10%!
At the very end of the road, we however ended....on a fence. It's
apparently guarding the final part of the road where even more fancier
villas seem to be, according to the satellite view..:-).
We tried to use a small path up, but had to stop quite quickly.
(OK, No l is definitely blurry there....blame the tired eyes after
8.7km climbing all the way)
And then, all we had to do was....going down..:-). Being both in a
fairly good shape, that went quite fast. But we both agreed that the
final part, above 12km/h along the highway, with the sun hitting hard,
was quite a challenge.
I really admire those people who happen to run long distance in places
like Managua. I can't even imagine running a marathon here....