View source: R/hud_decomp_crosswalk.R
hud_cw_zip_countysub | R Documentation |
This function queries the USPS Crosswalks API provided by US Department of Housing and Urban Development (HUD USER). This returns the crosswalk for zip to countysub.
hud_cw_zip_countysub( zip, year = format(Sys.Date() - 365, "%Y"), quarter = 1, minimal = FALSE, key = Sys.getenv("HUD_KEY"), to_tibble = getOption("rhud_use_tibble", FALSE) )
zip |
A character or numeric vector: 5 digit (United States Postal Service) USPS zipcode of the data to retrieve. E.g. 22031 for type 1 to 5 and 11 . |
year |
A character or numeric vector: gets the year that this data was recorded. Can specify multiple years. Default is the previous year. |
quarter |
A character or numeric vector: gets the quarter of the year that this data was recorded. Defaults to the first quarter of the year. |
minimal |
A logical: return just the crosswalked geoids if TRUE. Otherwise, return all fields. This does not remove duplicates. |
key |
A character vector of length one with the key obtained from HUD (US Department of Housing and Urban Development) USER website. |
to_tibble |
A logical: if TRUE, return the data in a tibble format rather than a data frame. |
This function returns a dataframe containing crosswalk data for zip to countysub for all combinations of "zip", "year", and "quarter" inputs.
These measurements include res-ratio, bus-ratio, oth-ratio, tot-ratio. For more details on these measurements, visit https://www.huduser.gov/portal/dataset/uspszip-api.html
## Not run: hud_cw_zip_countysub(zip = 35213, year = c('2019'), quarter = c('2')) hud_cw_zip_countysub(zip = '35213', year = c('2019'), quarter = c('2'), minimal = TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.