Package 'CTPPr'

Title: Census Transportation Planning Products Program (CTPP) API
Description: Download Census Transportation Planning Products Program (CTPP) Tables for analysis in R
Authors: Anthony Fucci [aut, cre], Alex Cates [aut], Marcelo Simas [aut]
Maintainer: Anthony Fucci <[email protected]>
License: GPL-3
Version: 1.0.0
Built: 2025-03-03 03:03:00 UTC
Source: https://github.com/Westat-Transportation/CTPPr

Help Index


View CTPP Tables Available for Download

Description

This function returns a list of CTPP table identifiers and descriptions. You can click on the ID in the default version to copy an example download_ctpp() request to your clipboard.

Usage

ctpp_tables(style = "browser", select = NA)

Arguments

style

"raw" or "r" to return a r data.table object or "browser" (default) to return a javascript datatable

select

character vector of table id's. This will return only the tables specified, which may be useful for presentations or when you would like to hide records by default.

Examples

ctpp_tables()
ctpp_tables("raw")

Download CTPP Data

Description

This function allows you to download CTPP tables into R

Usage

download_ctpp(id, geography = "State", state = "", dataset = "",
  output = "Name")

Arguments

id

The identifier of the CTPP table you want to download (e.g. "A101100"). Type ctpp_tables() for a list of tables and their ids.

geography

The geography level of the requested table. Type ctpp_geography_list to see available geographies, or see Details below.

state

The state your request should subset to. Takes name ("Alabama"), abbreviation ("AL") or FIPS ("01"). Can be comma separated list ("New York, New Jersey"). Type ctpp_state_list to see available states.

dataset

"2010" or "2016" to specify which 5-year dataset to query.

output

How you want your records labelled. Default is "Name" unless geography is "Tract", "TAD", or "TAZ", in which case "FIPS Code" is used to reduce size of request. See Details below for example outputs.

Value

returns a data.table based on a default option CSV download request (tables available at the online CTPP browser)

Details

This function makes a bulk download request for the provided table id. Use this function with caution and subset to a specific state for smaller geography requests. See the example section for some recommendations on downloading and storing your results.

geography

Bold words below are accepted by geography= For Residence and Workplace Tables:

  • County - State-County

  • MCD - State-County-MCD (for 12 strong MCD states)

  • Place - State-Place

  • MSA - Metropolitan Statistical Area

  • City - Metropolitan Statistical Area - EACH Principal City

  • PUMA - State-PUMA5

  • UA - Urbanized Area (UA)

  • OUSA - Worked Outside United States (WORKPLACE tables only)

  • Tract - State-County-Tract

  • TAD - TAD

  • TAZ - TAZ

For Flow (Residence->Workplace) Tables:

  • State->State

  • County->County

  • MCD->MCD

  • Place->Place

  • City->City

  • PUMA->PUMA

  • County->Place

  • MCD->Place

  • PUMA->Place

  • Tract->Tract

  • TAD->TAD

  • TAD->TAZ

  • TAZ->TAZ

  • TAZ->TAD

  • Place->TAZ

  • TAZ->Place

state

Use state= in combination with geography=. If you don't, the requested table will be downloaded for the entire country and may not finish.

output

Option - Example

  • Name - "New York"

  • Key - "C0300US13001"

  • FIPS Code - "36"

  • FIPS and Name - "36 | New York"

  • Split FIPS Code - "36 | 001"

Examples

A102102 <- download_ctpp(
  id = "A102102",
  geography = "County",
  state = "GA"
)
A202100 <- download_ctpp(
  id = "A202100",
  geography = "MSA",
  state = "FL"
)
# save your tables for working with later
save(A102102, A202100, "CTPP-tables.RData")
# load tables back
load("CTPP-tables.RData")