View source: R/hud_omni_functions.R
hud_cw | R Documentation |
This function queries the USPS Crosswalks API provided by US Department of Housing and Urban Development (HUD USER).
hud_cw( type, query, year = format(Sys.Date() - 365, "%Y"), quarter = 1, minimal = FALSE, key = Sys.getenv("HUD_KEY"), to_tibble = getOption("rhud_use_tibble", FALSE) )
type |
Must be a number between 1 and 12 depending on the USPS Crosswalk type. You can also supply the string name.
|
query |
5 digit USPS ZIP code of the data to retrieve. E.g. 22031 for type 1 to 5 and 11 . or 11 digit unique 2000 or 2010 Census tract GEOID consisting of state FIPS + county FIPS + tract code. Eg: 51059461700 for type 6 or 5 digit unique 2000 or 2010 Census county GEOID consisting of state FIPS + county FIPS. Eg: 51600 for type 7 or 5 digit CBSA code for Micropolitan and Metropolitan Areas Eg: 10380 for type 8 or 5-digit CBSA Division code which only applies to Metropolitan Areas. Eg: 35614 for type 9 or 4-digit GEOID for the Congressional District which consists of state FIPS + Congressional District code. Eg: 7200 for type 10 or 10-digit GEOID for the County sub Eg: 4606720300 for type 12 |
year |
Gets the year that this data was recorded. Can specify multiple years. Default is the previous year. |
quarter |
Gets the quarter of the year that this data was recorded. Defaults to the first quarter of the year. |
minimal |
Return just the crosswalked GEOIDs if true. Otherwise, return all fields. This does not remove duplicates. |
key |
The key obtained from HUD (US Department of Housing and Urban Development) USER website. |
to_tibble |
If TRUE, return the data in a tibble format rather than a data frame. |
This function returns a dataframe containing crosswalk data for one geoid to another for all combinations of "query", "year", and "quarter" inputs where query depends on type specified.
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
crosswalk()
hud_cw_zip_tract()
hud_cw_zip_county()
hud_cw_zip_cbsa()
hud_cw_zip_cbsadiv()
hud_cw_zip_countysub()
hud_cw_zip_cd()
hud_cw_tract_zip()
hud_cw_county_zip()
hud_cw_cbsa_zip()
hud_cw_cbsadiv_zip()
hud_cw_cd_zip()
hud_cw_countysub_zip()
hud_cw()
## Not run: hud_cw(type = 1, query = "35213", year = c("2010", "2011"), quarter = c("1")) hud_cw(type = "2", query = "35213", year = c("2016", "2020"), quarter = c("2")) hud_cw(type = 3, query = 35213, year = c("2012", "2011"), quarter = c("3")) hud_cw(type = 4, query = "22031", year = c("2017", "2019"), quarter = c("4")) hud_cw(type = "5", query = "35213", year = c(2011, "2012"), quarter = c("1", "2")) hud_cw(type = 6, query = "48201223100", year = c("2017", "2010"), quarter = c("1", "2", "3")) hud_cw(type = 7, query = "22031", year = c("2010", "2011"), quarter = c("1", "2", "3")) hud_cw(type = 8, query = "10140", year = c("2010", "2011"), quarter = c("1", "2")) hud_cw(type = 9, query = "10380", year = c("2017"), quarter = c("4")) hud_cw(type = 10, query = "2202", year = c("2010", "2011"), quarter = c("4", "3")) hud_cw(type = 11, query = "35213", year = c("2019", "2020"), quarter = c("2", "3")) hud_cw(type = 12, query = "4606720300 ", year = c("2019", "2019", "2019"), quarter = c("4", "4")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.