RProtoBuf 0.4.0: A whole lot of goodies and Windoze support

January 20, 2014

(This article was first published on Thinking inside the box , and kindly contributed to R-bloggers)

A new major release 0.4.0 of
is now on CRAN.
provides GNU R
bindings for the
Google Protocol Buffers (“Protobuf”)
data encoding
library used and released by Google, and deployed as a language and
operating-system agnostic protocol by numerous projects.

With this release, we are welcoming
Jeroen Ooms
to the team. Jeroen had already worked on some RProtoBuf extensions in the
context of his OpenCPU project; we have now
integrated those Protocol Buffers functions. And Jeroen pushed all the right buttons to
finally get RProtoBuf built on everybody’s least-favourite operating system
by provding a static library for use by
win-builder and
Murray once again did a lot of work on internals.
His use of the LLVM tool llvm-format was particular helpful to
make our coding style a little more consistent.

The complete NEWS file entry for this release follows:

Changes in RProtoBuf version 0.4.0 (2014-01-14)

  • Changes to support CRAN builds for MS Windows.

  • Added functions serialize_pb, unserialize_pb, and can_serialize_pb plus documentation from Jeroen Ooms RProtoBufUtils package.

  • New dir inst/python with some Python examples.

  • Added Jeroen Ooms as author.

  • Vignettes have been converted to the R 3.0.0 or later use of external vignette builders, no longer need a Makefile

  • Added missing methods to dollar completion list for Message, Descriptor, EnumValueDescriptor, and FileDescriptor classes.

  • Add missing export for .DollarNames EnumValueDescriptor to allow completion on that class.

  • Add more than 15 additional pages to the main Intro vignette documenting better all of the S4 classes implemented by RProtoBuf, updating the type mapping tables to take into account 64-bit support, and documenting advanced features such as Extensions.

  • Added better error checking in EnumDescriptors to catch the case when wrong types are provided.

  • Updated the FileDescriptor name() method to accept a boolean for full paths just like the generic name() method.

  • Correct a bug that incorrectly dispatched as.character() when as.list() was called on Descriptor objects.

  • Update FileDescriptor $ dispatch to work properly for the names of fields defined in the FileDescriptor, instead of just returning NULL even for types returned by $ completion.

  • Added a reservation for extension fields in the example tutorial.Person schema.

  • Support setting int32 fields with character representations and raise an R-level stop() error if the provided string can not be parsed as a 32-bit integer, rather than crashing the R instance.

  • Update the project TODO file.

  • Add better documentation and tests for all of the above.

  • Corrected the handling of uint32 and fixed32 types in protocol buffers to ensure that they work with numbers as large as 2^32 – 1, which is larger than an integer can hold in R since R does not have an unsigned integer class. These values are stored as doubles internally now to avoid losing precision.

  • Added unit tests to verify behavior of RProtoBuf with extreme values for uint32 types.

  • Removed old exception handling code and instead rely on the more modern Rcpp::stop method maintained in Rcpp.

  • Add better error messages when setting a repeated field of messages to inform the user which element index was of the wrong type and what the expected type was.

  • Add an optional ‘partial’ argument to readASCII allowing uninitialized message fragments to be read in.

  • (internal) Added const qualifiers in more places throughout the C++ code for type safety.

  • (internal) Standardize coding conventions of the C++ files and run them through clang-format for consistency. A STYLE file has been submitted to R-Forge with details about the coding standards and how they are enforced with Emacs and clang-format.

  • Applied changes suggested by Kevin Ushey to the S4 class handling to support both the currently released Rcpp as well as the currently pending next version.

CRANberries also provides a

diff to the previous release 0.3.2
More information is at the
page which has a
draft package vignette,
a ‘quick’ overview vignette
and a
unit test summary vignette.
Questions, comments etc should go to the
rprotobuf mailing list
off the RProtoBuf page at R-Forge.

This post by Dirk Eddelbuettel
originated on his Thinking inside the box blog.
Please report excessive re-aggregation in third-party for-profit settings.

To leave a comment for the author, please follow the link and comment on his blog: Thinking inside the box .

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.