-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Update: Download, tidy, and export data to staging area in Elmer via R.
- Open files:
config.R
,run.R
- Follow instructions in
run.R
and run line by line where necessary.
In Elmer, you can find staged tables in stg.ofm_apr_intercensal
, stg.ofm_apr_postcensal
, and stg.ofm_apr_postcensal_housing
.
- Once staging tables have been officially incorporated to the main tables, knit the .Rmd in subfolder
process > OFM > summary
to view an html data summary of post-censal estimates in Elmer.
CHAS_ETL.R This script reads CHAS data from the HUD website, downloads it, unzips it, and puts it in the Elmer staging database. Prior to running the script make the following edits to the year(s) in the filenames. Visit the website to see what year ranges are available.
- Revise line 9
data_file_name <- '<yyyy>thru<yyyy>-140-csv.zip.zip'
. - Revise line 44
data_dict_name <- 'CHAS data dictionary <yy>-<yy>.xlsx.xlsx'
- Revise line 46
elmer_table_name <- 'chas_tbl_9_<yyyy>'
For more information visit: https://www.huduser.gov/portal/datasets/cp.html.
Additional background info can be found here: http://aws-linux/mediawiki/index.php/Comprehensive_Housing_Affordability_Strategy_(CHAS)
After the data has been put in the staging database, addition scripts in process/CHAS
is used to put the data into facts and dimensions and add geographic information.
CHAS_API.R allows you to query county level summaries for the PSRC region via the CHAS API. Running the script 'as-is' will pull the latest county-level data for the region.
The API is equivalent to the Query
tab on their interface.
Tract level data is not available but the following summaries can be obtained via API:
- Nation
- State
- County
- MCD
- Place