Choroplethr, ggplot2 and R-Hub

Choroplethr v3.3.1 is now on CRAN. You can get it by typing the following from the R command line:


Note that while the new version is now on CRAN, it sometimes takes a few days for all of the CRAN mirrors to update. If you are unable to get the latest version from CRAN, you can install it from github (instructions).

Compatibility with ggplot v2.0.0

The reason for this update is compatibility with the latest version of ggplot2 (link). Shortly after the latest version of ggplot2 was released, choroplethr users started reporting the following error to me:

Error: Don’t know how to add self$ggplot_polygon to a plot

It took me a little while to realize that the problem was incompatibility with the new version of ggplot2. Once I realized the problem I was able to make the necessary changes and submit an updated version to CRAN.

Based on the number of packages which use ggplot2, I am guessing that R users might experience temporary problems with other packages as well. You can see the full list of packages which use ggplot2 here.

Enter the R Consortium and R-Hub

The update to ggplot2 was a major change. I mean “major change” in the sense of semantic versioning, not marketing. The changes were significant enough to potentially break code that depends on ggplot2.

Within the world of software engineering this is a fairly common occurence. What’s challenging about the R ecosystem is that there are so many packages, dependencies and authors that coordination about major changes can be difficult. Also, many authors only work part time on their R packages.

The good news is that the newly developed R Consortium has funded a project to help with this exact issue.The project is called R-Hub, and is led by Gábor Csárdi. You can read the press release about it here, and the full proposal here.

I am really looking forward to seeing what happens with R-Hub. It has the potential to reduce the risk that package authors face when making changes to their packages. Reducing this risk might result in even more innovation in the R ecosystem.

Gergely Daróczi says December 23, 2015

I truly feel for you, as the very same problem happened to me with the “pander” package in September 2012 with ggplot2 0.9.2 and I had to submit a hotfix release to CRAN 🙂 But I think since then, Hadley is very attentive with the updates by running checks on the many reverse dependencies and sending e-mails about the forthcoming release to all related package developers — just like he did in mid-October and then in November again for this release and in April 2014 for ggplot2 1.0 before submitting to CRAN. Alternatively, you can subscribe to the “releases” RSS feed on GitHub for ggplot2 — but I truly think Hadley does a very good job in managing the ggplot2 updates. Anyway, keep up the good work!

    Ari Lamstein says December 23, 2015

    Yes, Hadley did a great job in communicating the change – this is just one more way that Hadley is a role model in the R community.

    But things get tricky when your package imports other packages which also import the changed package. In my case Hmisc also needed to be updated as a result of the change. I think that the update to Hmisc was quickly submitted to CRAN and approved, but I could not get the new binary from CRAN. And building the version from source was complicated, because it wound up requiring me to install new 3rd party software (Fortran). I can imagine R-Hub somehow facilitating this.

    For me the most important point is this: If a system is created to make this easier, then it will be easier for authors to make similar major updates in the future.

      Gergely Daróczi says December 23, 2015

      Yeah, I totally agree: R-Hub will be extremely useful and I’m also looking forward to seeing it in action soon.

Comments are closed