All examples By author By category About

tonmcg

Sankey Diagram with Crossfilter

Source: Office of Management and Budget, Tables 14-3 through 14-39. 2018 Budget State-by-State Tables

This Sankey shows the flow of obligation data for select U.S. Federal Government grant programs on a state-by-state basis. These data are actuals and estimates from the FY 2018 President's Budget.

The Sankey employs a few novel features:

I wrote an R script to wrangle, munge, and tidy the data into a CSV file using the tidyverse R package. Connecting to the OMB-hosted data required that I use the RStudio Excel import feature, which produced this code snippet:

url <- "https://www.whitehouse.gov/sites/whitehouse.gov/files/omb/budget/fy2018/state_by_state052417.xls"
destfile <- "state_by_state052417.xls"
download.file(url, destfile)