Choroplethr Packages

While Choroplethr is conceptually one body work, the Central R Archive Network (CRAN) has required me to split the project into five separate R packages. Those packages are:

  • choroplethr
  • choroplethrMaps
  • choroplethrAdmin1
  • choroplethrZip
  • rUnemploymentData

Below is a list of a each package, along with information to help you install and use it.

Each package description contains a link to “view package contents”. That link will take you to a separate page that lists each function and data object in each page, and provides examples of their use.

ch​oroplethr

Choroplethr is the main package in the project. It contains an R6 object for creating choropleth maps from arbitrary shapefiles as well as functions for rendering almost every map in the project. (The one exception is ZIP Code Maps, which are handled in the package choroplethrZip). The maps is renders are:

  • US states, counties and census tracts
  • Countries of the world
  • Administration level 1 maps (i.e. state / province maps) for each country

It also provides functions for getting and mapping data from the US Census Bureau and World Bank.

To install the latest version of choroplethr, type the following:


install.packages("choroplethr")

choroplethrMaps

The choroplethrMaps package contains many of the maps used by the Choroplethr package. The maps are:

  • US States
  • US Counties
  • Countries of the world

The US maps in this package from the US Census Bureau. The international map comes from Natural Earth Data.

To install the latest version of choroplethrMaps, type the following:


install.packages("choroplethrMaps")

choroplethrAdmin1

The choroplethrAdmin1 package contains an Administrative Level 1 map of most countries of the world. “Administrative Level 1” is a general term for “the first level of division within a country.” In the US Administrative Level 1 regions are called “states”, in Canada they are called “provinces” and so on.

To install the latest version of choroplethrAdmin1, type the following:


install.packages("choroplethrAdmin1")

choroplethrZip

The choroplethrZip package contains a map and visualization functions for US Zip Code Tabulation Areas (ZCTAs). While ZCTAs are a good approximation of ZIP Codes, they are not identical: ZIP Codes are maintained by the US Postal Service and ZCTAs are maintained by the Census Bureau.

ZCTA / ZIP Code maps are complicated, and I dedicate three lessons of Mapmaking in R with Choroplethr to a discussion of this map.

Due to this package’s size (~60MB) it is hosted on github, not CRAN. To install the latest version of choroplethrZip, type the following:

# install.packages("devtools")
library(devtools)
install_github('arilamstein/[email protected]')

rUnemploymentData

The rUnemploymentData package contains data and visualization functions for US Unemployment Data. The data comes from the US Bureau of Labor Statistics (BLS) Local Area Unemployment (LAU) datasets.

The data includes State and County data. The State dataset covers 2010-2013 and the County dataset covers 1990-2013.

To install the latest version of rUnemploymentData, type the following:

install.packages("rUnemploymentData")