Vermont Post Offices

Tidy Tuesday post offices.

David Fox true
04-14-2021

Get the data - I’ll filter down to Vermont.

post_offices <- readr::read_csv(
  'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-04-13/post_offices.csv')

vt_post_offices <- post_offices %>% 
  filter(state == "VT")

Let’s look at when Vermont post offices were established. There a couple of different ways to slice this - histograms are nice, since it is easy to roll up to decades for example. Looks like the 1830’s was big for post offices. There was another bump post Civil War and things slowed down after that.

vt_post_offices %>%
  ggplot(aes(x= established)) +
    geom_histogram(binwidth = 10, color = "grey90", fill = "#3B9AB2FF") +
  labs(title = "Number of Vermont post offices established per decade.",
       x = NULL,
       y = NULL)

And the same, but for discontinued. Looks like some major changes in the post office system occurred in the first decade of the 1900’s. Cars probably changed a lot for the postal service, but this seems a bit early for that effect. It is interesting that the 1890’s were a the last bumper year for new post offices, but then in 1900 a bunch were closed.

vt_post_offices %>%
  ggplot(aes(x= discontinued)) +
  geom_histogram(binwidth = 10, color = "grey90", fill = "#E1AF00FF") +
  labs(title = "Number of Vermont post offices closed per decade.",
       x = NULL,
       y = NULL)

It would be nice to show this as the total number of post offices. I was thinking about doing a cumulative sum and then subtracting a cumulative sum of closed post offices. However this doesn’t give the history of each individual post office, which is what we need if we want a time series map. When I’m doing a Tidy Tuesday project I try to avoid watching David Robinson’s video first, so I don’t just copy his approach. In this case, I was a bit stumped on how to pivot having all the years a post office was extant. Of course - David showcased what I needed to do. What he does is create a new column that is a nested list of the sequence of years between when the post office was established and discontinued, then unnests the list. This will give us one row for each year a post office was open. One thing to watch is that the data has NA for post offices that are still around, so we need to change that to a real value. Looking at the data, it should be valid up to 2000.

vt_po_long <- vt_post_offices %>% 
  select(name, county1, established, discontinued,latitude,longitude) %>% 
  mutate(discontinued = replace_na(discontinued, 2000)) %>% 
  mutate(year = map2(established, discontinued, seq)) %>% 
  unnest(year)

head(vt_po_long)
# A tibble: 6 x 7
  name    county1    established discontinued latitude longitude  year
  <chr>   <chr>            <dbl>        <dbl>    <dbl>     <dbl> <int>
1 ADAMANT WASHINGTON        1905         1991     44.3     -72.5  1905
2 ADAMANT WASHINGTON        1905         1991     44.3     -72.5  1906
3 ADAMANT WASHINGTON        1905         1991     44.3     -72.5  1907
4 ADAMANT WASHINGTON        1905         1991     44.3     -72.5  1908
5 ADAMANT WASHINGTON        1905         1991     44.3     -72.5  1909
6 ADAMANT WASHINGTON        1905         1991     44.3     -72.5  1910

Peak Post Office

vt_po_long %>%
  count(year, name ="total_PO") %>% 
  ggplot(aes(year, total_PO)) +
  geom_area(fill = '#78B7C5FF') +
  labs(title = "Rise and fall of Vermont post offices",
       x = NULL, 
       y = "total open post offices")

So at the turn of the last century, Vermont had 582 post offices - quite a few considering there were only about 344,000 people in the whole state.

vt_po_long %>%
  count(year, name ="total_PO") %>%
  arrange(desc(total_PO)) %>% 
  slice_head %>% 
  knitr::kable()
year total_PO
1900 582

Old Infrastructure

There are 3 post offices that have been open since 1784, one from that year was closed for a time, and there are others that have been in continuous operation since the 1790’s.

vt_post_offices %>% 
  filter(is.na(discontinued)) %>% 
  select(name, county1, established, continuous) %>% 
  arrange(established) %>% 
  slice_head(n=10) %>% 
  knitr::kable()
name county1 established continuous
BRATTLEBORO WINDHAM 1784 TRUE
NEWBURY ORANGE 1784 FALSE
RUTLAND RUTLAND 1784 TRUE
WINDSOR WINDSOR 1784 TRUE
BURLINGTON CHITTENDEN 1792 TRUE
MANCHESTER BENNINGTON 1793 TRUE
MIDDLEBURY ADDISON 1793 TRUE
VERGENNES ADDISON 1793 TRUE
WESTMINSTER WINDHAM 1794 TRUE
FAIR HAVEN RUTLAND 1797 TRUE

Most recent.

The most recent extant post office was established in 1961 and the top ten goes back to 1913 - so not much development of the system in the last 100 years.

vt_post_offices %>% 
  filter(is.na(discontinued)) %>% 
  select(name, county1, established, continuous) %>% 
  arrange(desc(established)) %>% 
  slice_head(n=10) %>% 
  knitr::kable()
name county1 established continuous
SHAFTSBURY BENNINGTON 1961 TRUE
EAST SAINT JOHNSBURY CALEDONIA 1952 TRUE
LAKE ELMORE LAMOILLE 1944 TRUE
NORTON ESSEX 1932 TRUE
CRAFTSBURY COMMON ORLEANS 1931 TRUE
KILLINGTON RUTLAND 1926 FALSE
ASCUTNEY WINDSOR 1924 TRUE
READING WINDSOR 1922 TRUE
GILMAN ESSEX 1921 TRUE
FLORENCE RUTLAND 1913 TRUE

Let’s look at this as County trends.

vt_po_long %>% group_by(county1) %>% 
  count(year, name ="total_PO") %>% 
  ggplot(aes(year, total_PO, fill =county1)) +
  geom_area() +
  facet_wrap(~county1, ncol = 3) +
  scale_fill_paletteer_d('ggsci::default_igv') +
  theme(legend.position = "Null",
        axis.text.x = element_text(angle = 45, hjust = 1))

If you are familiar with Vermont geography, these trends closely match County sizes. While correlated with population, there are some outliers. Chittenden County is the most populous county, but in 2000 at least looks to have fewer post offices left than Rutland or Windsor.

Left Standing

Let’s look at when post offices that were still open in 2000 were first established. Looks like the majority of the post offices still operating in 2000 were established between 1800 and 1850. This was the original hey day of Vermont - after the Civil War, many people moved west. Interestingly there have been almost no new post offices established, despite Vermont’s modestly growing population - which ticked up in the 1970s in particular.

vt_post_offices %>% 
  filter(is.na(discontinued)) %>% 
  ggplot(aes(established)) +
  geom_histogram(binwidth =10, color = "grey90", fill = '#046C9AFF') +
  labs(title = "Year in which still open post offices were established",
       x = NULL, 
       y = NULL)

Spatial

Since we have lat/long coordinates, it is strait forward to map out this data. I originally had ambitions to make an animated map, but the result turned out to be less than compelling, so here I’ll just map the heyday of post offices in 1900 and what was left as of 2000. We’ll pull County boundaries for context with the {USAboundaries} package.

# Convert the latitude and longitude columns into a geographic feature

po_spatial <- vt_po_long %>% 
  drop_na() %>%   #no na's allowed in converting to sf
  filter(year %in% c(1900,2000)) %>% 
  mutate(year = as_factor(year)) %>% 
  st_as_sf(coords = c("longitude", "latitude"), crs=4326)

# get Vermont's county bounds  
vt_counties <- us_counties(states = "Vermont")
ggplot(data=vt_counties) +
  geom_sf() +
  geom_sf(data = po_spatial, aes(color = established), alpha = .6) +
  theme_map() +
  theme(legend.position = "bottom") +
  scale_color_viridis_c(option = 'A',
                        name = "year established",
                        guide = guide_colorbar(
                          direction = 'horizontal',
                          barheight = unit(2, units = 'mm'),
                          barwidth =  unit(30, units = 'mm'),
                          title.position = 'top',
                          nrow = 1
                        )) +
  facet_wrap(~year) +
  labs(title = "100 years of post office closures")