User Question: How to Add a State Border to a Zip Code Map?

A user recently asked me how to add a state outline to a Zip Code map. Consider this map, which shows the percent white of each Zip Code Tabulated Area (ZCTA) in New York and New Jersey:


Clearly the ZCTAs in northern New York have the highest concentration of white residents. However, it would still be useful to see the border between New York and New Jersey.

Step 1: Build the Initial Map

This map has one complexity to it: it hides the actual ZCTA borders. This technique is very useful when viewing a large number of Zip codes and is described in detail here.

Step 2: Create the State Outlines

State outlines are rendered in the render_state_outline function in the USAChoropleth object. Here is how to store the outline:

Step 3: Render the Combined Maps

The zip map and the outline are both ggplot objects. This means that they can be combined with the + sign: