get_geo: Load geographic data from the HUD API

Description Usage Arguments Value

View source: R/get_data.R

Description

get_geo() loads geographic data for states, counties, or metro areas from the HUD API. This function is particularly useful for looking up county and METRO codes.

Usage

1
2
3
4
5
6
7
8
get_geo(
  geography,
  state = NULL,
  token = get_token(),
  drop_empty_cols = TRUE,
  tibble = TRUE,
  show_url = FALSE
)

Arguments

geography

Geography of data to pull. One of "state", "county", or "metro".

state

If geography is "county", what state to pull data for. Specify as a two-letter state abbreviation. The 50 states plus DC, AS, GU, MP, PR, and VI are supported.

token

HUD API access token. Defaults to environment variable HUD_API_TOKEN.

drop_empty_cols

If TRUE (default), drop empty columns in returned data.

tibble

If TRUE (default), return data as a tibble. Otherwise, return data as a base data frame.

show_url

If TRUE, show URL the request was sent to. Defaults to FALSE.

Value

A tibble or base data frame with requested data.


CenterOnBudget/hudapi documentation built on July 6, 2021, 2:53 p.m.