Choroplethr v3.5.3 is now on CRAN

A new version of choroplethr is now on CRAN. You can get it by typing the following:

[code lang=”r”]

install.packages("choroplethr")

packageVersion("choroplethr")

[1] ‘3.3.1’

[/code]

Motivation

This new version was motivated by a few warnings that had started appearing since the latest update to ggplot2:

[code lang=”r”]
library(choroplethr)
data(df_pop_state)
state_choropleth(df_pop_state)

Warning messages:
1: `panel.margin` is deprecated. Please use `panel.spacing` property instead
2: `panel.margin` is deprecated. Please use `panel.spacing` property instead
3: `panel.margin` is deprecated. Please use `panel.spacing` property instead
[/code]

These warnings did not effect the actual functionality of choroplethr. But the issue that caused them has been resolved.

Outstanding Issue: Reference Maps

It appears like the latest issue of ggplot2 has also caused issues with the ggmap package. Choroplethr uses ggmap when superimposing choropleth maps over reference maps (i.e. setting “reference_map=TRUE”).

[code lang=”r”]

library(choroplethr)

data(df_pop_county)
county_choropleth(df_pop_county, state_zoom="california", reference_map=TRUE)

Error: GeomRasterAnn was built with an incompatible version of ggproto.
Please reinstall the package that provides this extension.

[/code]

One workaround for this is to use the development version of ggmap, which you can get from github like this:

[code lang=”r”]

library(devtools)
install_github("dkahle/ggmap")

# restart R

library(choroplethr)
data(df_pop_county)
county_choropleth(df_pop_county, state_zoom="california", reference_map=TRUE)

[/code]

I do not know when the maintainer of ggmap is planning to push this fix to CRAN.

Documentation Changes

This update also changes how I handle documentation for choroplethr.

In the past choropethr had several vignettes which I published online via CRAN. I’m now trying to consolidate all the documentation for my open source projects here on my own website. If you’d like to view the old choroplethr vignettes, you can still do so. They are on my new “Open Source” page here: https://arilamstein.com/open-source.

 

Ari Lamstein

Ari Lamstein

I’m a software engineer who focuses on data projects.

I most recently worked as a Staff Data Science Engineer at a marketing analytics consultancy. While there I developed internal tools for our data scientists, ran workshops on data science and mentored data scientists on software engineering.

Thanks for visiting!

Sign up to stay up to date with the latest blog posts: