I’m extremely grateful to Stacey Bricka of MacroSys and Shichen Feng of the Fresno COG to provide insights and help in curing my logjam/frustrations.

I’ve uploaded a 10 example R-script to pull data from the CTPP 2017-2021 data for Parts 1, 2, and 3 at various geographic levels. 

Here it is:



I recommend having the CTPP Data Portal open in a web browser to help assist in selecting tables and understanding geographic levels associated with any of the tables.

Most challenging was my attempt to pull tract-to-tract worker flow for my region. I think there is an upper limit on the number of records that can be pulled in the API, somewhere between 50,000 records and 5,000,000 records. 

Next steps:

1. renaming variable names to be more mnemonic and memorable.
2. attaching GIS files using either tidycensus or the r package tigris.
3. mapping all of the cool patterns
4. summarizing tract-to-tract worker flows to county-to-county level, to ascertain data loss due to lack of secondary allocation.
5. There probably should NOT be any data loss in any place-to-county or county-to-place summary levels. Check this.


Hope this is of interest and use to the community.

cheers,

Chuck Purvis
Hayward, California

or contact me directly, at: clpurvis@att.net

# # # # #