But I feel that this is a good start for what could eventually be a swiss army knife for ZIP codes and ZIP code level data in R. I still want to implement additional features for performing geographic lookups and relating ZIP code data to Census data. The work of building a feature-complete zipcode library R is not over with this release. HOW TO INSTALL PACKAGE IN R FROM ZIP HOW TO# Get all Census tracts for a given ZIP codeįull details on how to use the various functions of zipcodeR can be viewed from the project’s documentation. Get every Census tract that falls within a given ZIP code (suitable for joining to shapefiles)Īnd here is an example of basic usage of the zipcodeR library: # Load the library into your R session.Search ZIP codes based upon which timezone they fall in.Here’s what is currently working in v0.1.0: Most of the basic functions one would expect from a library handling ZIP codes have been implemented, although there are still additional features I am hoping to implement in the future. Then, install zipcodeR by running devtools::install_github("gavinrozzi/zipcodeR")Īt this point, after about a weekend worth of work on this, I feel that zipcodeR is now at the minimum viable product stage. Make sure you have devtools installed on your system first by running install.packages('devtools') The latest development version of the package can be installed directly from Github using devtools. You can install it from the R console by running: install.packages('zipcodeR') UPDATE: zipcodeR can now be installed from CRAN, the official R package library. In creating this package, I wanted to both find a way of simplifying my personal workflow by eliminating the drudgery of making multiple calls to read_csv() and dplyr to filter and wrangle ZIP code data, while also avoiding the work of manually integrating outside data sources everytime I wanted to do something with data at the ZIP code level. That packaged provided data on ZIP codes aggregated from multiple sources similar to the data I am working with for zipcodeR, as well as a basic function for cleaning up improperly formatted ZIP codes, but was primarily just a wrapper for a dataframe with data about ZIP codes. Filling a void in the R ecosystemįor example, the only package I was able to find on CRAN that offered something comparable was the package zipcode, which was last updated in 2012 and archived from CRAN in early 2020 due to a lack of maintenance. There are a few good libraries for Python that provide useful data and functions for looking up ZIP codes and related data, such as uszipcode but nothing with similar functionality is currently available for R, hence the motivation for creating zipcodeR. And since here in New Jersey, our ZIP codes start with leading zeroes, I’m used to R, Excel and other tools being “helpful” and cutting off the leading zeroes, making the ZIP codes not terribly useful. There’s really nothing special about ZIP codes, as they really only exist to identify USPS service areas, and are not meant to track demographic changes over time such as Census tracts, but they are still an ubiquitous and widely understood way of identifying the approximate geographic location of data, such as COVID-19 case counts.įor data science projects involving data that is at the ZIP code level, I’ve found myself doing a lot of repetitive tasks for reading in and integrating ZIP codes. Social science researchers, data scientists and others who are studying topics in the United States have likely come across data at the ZIP code level. HOW TO INSTALL PACKAGE IN R FROM ZIP UPDATEUpdate : a new version of the package has been published. HOW TO INSTALL PACKAGE IN R FROM ZIP OFFLINEThe package provides a comprehensive, offline dataset for US ZIP codes in addition to integrating outside open data sources from the Census Bureau and Department of Housing & Urban development to aid researchers and data science practitioners working with ZIP code-level data in R. (h/t /AXGee1QQwZ- R for the Rest of Us September 28, 2020 Need to get, say, all zip codes in Seattle? The new package by makes it super simple. In this post I will introduce zipcodeR, my new open-source R package that provides a set of integrated functions and data that make working with ZIP code-level data easier in R.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |