Note: The rendered pages stored in this repository are old. Visit Measuring Upward Mobility in Counties and Cities Across the US to see pages for all 3,143 counties and 486 of the largest cities.
This repository contains tools for iterating Mobility Metrics Data Tables for Measuring Upward Mobility in Counties and Cities Across the US. The code iterates 3,143 county websites (example: Los Angeles County) and 486 city websites (example: Philadelphia). The following resources feed into the pages:
- Mobility metrics code
- Mobility metrics Urban Institute Data Catalog page
- Mobility metrics data dictionary
This repository is only one piece of a multi-year and multi-team effort around boosting upward mobility from poverty. The following resources provide useful background information on the project:
- Project website
- Boosting Upward Mobility: Metrics to Inform Local Action (2nd Edition)
- Boosting Upward Mobility: Metrics to Inform Local Action Technical Report (2nd Edition)
This code works successfully on R 4.2.2
and RStudio 2023.03.0
. Consider updating if you are on older versions of the software and are experiencing issues.
The Urban Institute uses the font Lato. Go to Control Panel
> Appearance and Personalization
> Fonts
to see if Lato is installed on your computer. Contact the IT Helpdesk if Lato isn't installed on your computer.
- If needed, update
mobility-metrics/
with updated data from the mobility metrics code. R/create_standard_county_df.R
andR/create_standard_place_df.R
create the data used to iterate the pages. The files created by these scripts,data/999_all-counties.Rda
anddata/998_all-places.Rda
, rarely need updating.- Launch an EC2 instance with 64 to 128 cores. Memory-optimized machines are ideal.
create_standard_pages.R
iterates the pages. Be sure to setNCORES
to align with the instance specs from step 3.- Use
aws_cp_command.sh
to copy pages from the EC2 instances to the S3 bucket where pages are hosted and accessible to the tool interface. test_copy.qmd
ensures that all pages were correctly copied to the S3 bucket.
- Clone the repository on to your local machine with
git clone https://github.com/UI-Research/gates-mobility-metrics-pages.git
. - Create a new branch called
<your-name>
withgit checkout -b <your-name>
. - If you had previously completed steps 1 and 2, then confirm you are on the correct branch with
git branch
and rungit pull origin master
to update your local branch with remote changes. - Create a .csv with the name
##_name.csv
(e.g.01_rfi-applicants.csv
) in the data folder. The file should contain:state
The state name.county
The county name.fips
The 5-digit county FIPS code for the base county.comparisons
5-digit county FIPS codes separated by semicolons for comparison counties.random_id
A 3-digit random ID.
- Update
create_bespoke_pages.R
. Add a comment that describes the task and then addprep_pages()
andrender_pages()
. Runlibrary(tidyverse)
,source("R/prep_pages.R")
, andsource("R/render_pages.R")
before running your new lines of code. Don't run other lines of code. - Add the new URLs to the README under a section for the request.
- Add, commit, and push your local branch to GitHub with GitHub Bash (your command line tool).
- Put in a pull request to the master branch (in the web browser).
- Aaron R. Williams
- Gabriel Morrison
- Vivian Zheng