Tuesday, December 6
Agenda
Spreadsheet-Made Data Visualizations That Are Relatively Simple and Absolutely Effective
Carto, Political Boundaries, SQL, and Guns and Coffee
Assignments
In class tutorial:
Carto, SQL, and Political shapefiles
Things to download for Carto work:
Copy-and-paste the following URLs (from this subset of data) and import into your Carto Dataset maker:
- https://dannguyen.github.io/sql-carto-journalism-exercises/data/shapefiles/congress_districts_114th.zip
- https://dannguyen.github.io/sql-carto-journalism-exercises/data/shapefiles/us_county_shapes.zip
- https://dannguyen.github.io/sql-carto-journalism-exercises/data/shapefiles/zcta_simplified.zip
- https://dannguyen.github.io/sql-carto-journalism-exercises/data/wrangled/congressmembers.csv
- https://dannguyen.github.io/sql-carto-journalism-exercises/data/wrangled/starbucks_locations.csv
Later on in the lesson, we will use this lookup table, which I name us_state_codes
, to join the shapefile and congressmembers data together. It's going to feel like an annoyingly elaborate detail, but that's because we live in a world where the Census shapefile doesn't use postal abbreviations (e.g. CA
), and the Congressmembers datafile doesn't use FIPS code 06
The key thing in uploading this file to Carto is that, in the Connect Dataset pop-up, you should uncheck the box in the lower-left corner corner to prevent Carto from auto-converting text strings into numbers. We want our fips
column to be '06'
and not the integer 6
:
https://dannguyen.github.io/sql-carto-journalism-exercises/master/data/lookups/us_state_codes.csv