Ari Lamstein

New package on CRAN: zctaCrosswalk

I am happy to announce that my new R package, zctaCrosswalk, is now on CRAN. This package contains the US Census Bureau’s 2020 ZCTA to County Relationship File, as well as convenience functions to translate between States, Counties and ZIP Code Tabulation Areas (ZCTAs). You can install the package like this:

install.packages("zctaCrosswalk")

This package is exciting because, in many ways, it supplants my package choroplethrZip, which I developed around 2016.

I spent a great deal of time documenting the package. Rather than walk through the package here, I will refer you to the vignettes I wrote. From R, you can view them like this:

browseVignettes("zctaCrosswalk")

For convenience, here is a link to the vignettes on CRAN:

  1. Introduction
  2. Workflow with tidycensus
  3. Developer Notes

This package was developed after posting an issue on the repo of Kyle Walker’s excellent tigris package (link). In short, while tidycensus/tigris lets you download and view data at the level of ZIP Code Tabulation Areas (ZCTAs), it only provides the data and map for the entire nation. That is, it does not allow you to filter down to ZCTAs in specific states or counties. The zctaCrosswalk package is designed with the modest goal of providing that functionality. Please read the second vignette (Workflow with tidycensus) to see an example of that workflow. The final example in that vignette teaches you how to create a map of the median income of ZCTAs in San Francisco County, which looks like this:

Having worked in this field for a while, my interest in education has increased. I would like more people to both understand the underlying data and be able to write packages like this. If this interests you, please read the third vignette (Developer Notes).

I would also like to thank my employer, MarketBridge, for allowing me to spend the time to create this package. If you are interested in working at a company that uses R and values contributing to open source software, I highly recommend you apply to one of our many job openings.

Ari Lamstein

Ari Lamstein

I currently work as a Staff Data Science Engineer at a marketing analytics consultancy. I have 20 years experience developing software in areas such as data science, web development and video games. I have also worked as a technical trainer and independent consultant.

Thanks for visiting!

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