Package 'hudr'

Title: Providing Data from the US Department of Housing and Urban Development
Description: Provides functions to access data from the US Department of Housing and Urban Development <https://www.huduser.gov/portal/dataset/fmr-api.html>.
Authors: Paul Richardson
Maintainer: Paul Richardson <[email protected]>
License: GPL (>= 3)
Version: 1.2.0
Built: 2024-08-29 07:14:12 UTC
Source: CRAN

Help Index


Package that provides data from HUD.

Description

Provides functions to access data from the US Department of Housing and Urban Development https://www.huduser.gov/portal/dataset/fmr-api.html.

Details

Provides data from the US Department of Housing and Urban Development (HUD).

References

<https://www.huduser.gov/portal/dataset/fmr-api.html>


Get HUD Comprehensive Housing Affordability Strategy (CHAS) data at the Place, MCD, County, State, National Level from HUD.

Description

Provides Comprehensive Housing Affordability Strategy (CHAS) data at the Place, MCD, County, State, National Level from HUD.

Usage

get_hud_chas_data(
  entityid,
  stateid,
  type,
  yr,
  hud_key = Sys.getenv("HUD_API_KEY")
)

Arguments

entityid

Character string containing the 'fips_code' from get_hud_fmr_listcounties(...) or 'cbsa_code' from get_hud_fmr_listmetros(...).

stateid

Character string containing the 'fips_code' for the State.

type

Character string indicating the summary level. Option include 1-5. 1 - Nation, 2 - State, 3 - County, 4 - MCD, 5 - Place.

yr

Character string indicating the year.

hud_key

Character string indicating your API key from HUD.

Details

Provides fair market rent data at the County and MSA level from HUD.

Value

A list of data tables containing fair market rent data from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

chas_cnty_dt <- get_hud_chas_data(entityid = "033", stateid = "53",
                                  type = "3", yr = "2014-2018",
                                  hud_key = hud_key)

## End(Not run)

Get HUD Comprehensive Housing Affordability Strategy (CHAS) data at the Place, MCD, County, State, National Level from HUD.

Description

Provides a data.table containing the entityIds for all of the counties within a given state for the Comprehensive Housing Affordability Strategy (CHAS) data from HUD.

Usage

get_hud_chas_entityid_list(
  stateid,
  geo_lvl,
  hud_key = Sys.getenv("HUD_API_KEY")
)

Arguments

stateid

Character string containing the 'fips_code' for the State.

geo_lvl

Character string indicating either "county", "MDC", or "city".

hud_key

Character string indicating your API key from HUD.

Details

Provides fair market rent data at the County and MSA level from HUD.

Value

A list of data tables containing fair market rent data from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

chas_cnty_lst_dt <- get_hud_chas_entityid_list(stateid = "53",
                                               geo_lvl = "county",
                                               hud_key = hud_key)

## End(Not run)

Get HUD Fair Market Rent data at the County or MSA Level from HUD.

Description

Provides fair market rent data at the County and MSA level from HUD.

Usage

get_hud_fmr_data(entityid, yr, hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

entityid

Character string containing the 'fips_code' from get_hud_fmr_listcounties(...) or 'cbsa_code' from get_hud_fmr_listmetros(...).

yr

Character string indicating the year.

hud_key

Character string indicating your API key from HUD. Default is Sys.getenv("HUD_API_KEY").

Details

Provides fair market rent data at the County and MSA level from HUD.

Value

A list of data tables containing fair market rent data from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

cbsa_codes <- get_hud_fmr_listmetros(hud_key = hud_key)
cnty_codes <- get_hud_fmr_listcounties(hud_key = hud_key)

fmr_msa_dt <- get_hud_fmr_data(entityid = cbsa_codes$cbsa_code[1],
                               yr = "2020",
                               hud_key = hud_key)
fmr_cnty_dt <- get_hud_fmr_data(entityid = cnty_codes$fips_code[1],
                                yr = "2020",
                                hud_key = hud_key)

## End(Not run)

Get HUD List of County Codes data.

Description

Provides list of county codes data from HUD.

Usage

get_hud_fmr_listcounties(stateid, hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

stateid

Character string indicating the state.

hud_key

Character string indicating your API key from HUD.

Details

Provides list of county codes data from HUD.

Value

A data table containing a list of county codes from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

state_codes <- get_hud_fmr_listcounties(hud_key = hud_key)

## End(Not run)

Get HUD List of MSA Codes data.

Description

Provides list of MSA codes data from HUD.

Usage

get_hud_fmr_listmetros(hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

hud_key

Character string indicating your API key from HUD.

Details

Provides list of MSA codes from HUD.

Value

A data table containing a list of MSA codes from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

cbsa_codes <- get_hud_fmr_listmetros(hud_key = hud_key)

## End(Not run)

Get HUD List of State Codes data.

Description

Provides list of state codes data from HUD.

Usage

get_hud_fmr_liststates(hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

hud_key

Character string indicating your API key from HUD.

Details

Provides list of state codes data from HUD.

Value

A data table containing a list of state codes from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

state_codes <- get_hud_fmr_liststates(hud_key = hud_key)

## End(Not run)

Get HUD Fair Market Rent data at the State Level from HUD.

Description

Provides fair market rent data at the State level from HUD.

Usage

get_hud_fmr_statedata(entityid, yr, hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

entityid

Character string containing the 'state_code' from get_hud_fmr_liststates(...).

yr

Character string indicating the year.

hud_key

Character string indicating your API key from HUD. Default is Sys.getenv("HUD_API_KEY").

Details

Provides fair market rent data at the State level from HUD.

Value

A list of data tables containing fair market rent data from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

state_codes <- get_hud_fmr_liststates(hud_key = hud_key)

fmr_state_dt <- get_hud_fmr_statedata(entityid = state_codes$state_code[1],
                                      yr = "2020",
                                      hud_key = hud_key)

## End(Not run)

Get HUD Income Limit data at the County or MSA Level from HUD.

Description

Provides income limit data at the County and MSA level from HUD.

Usage

get_hud_il_data(entityid, yr, hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

entityid

Character string containing the 'fips_code' from get_hud_fmr_listcounties(...) or 'cbsa_code' from get_hud_fmr_listmetros(...).

yr

Character string indicating the year.

hud_key

Character string indicating your API key from HUD. Default is Sys.getenv("HUD_API_KEY").

Details

Provides income limit data at the County and MSA level from HUD.

Value

A list of data tables containing income limit data from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

cbsa_codes <- get_hud_fmr_listmetros(hud_key = hud_key)
cnty_codes <- get_hud_fmr_listcounties(hud_key = hud_key)

il_msa_dt <- get_hud_il_data(entityid = cbsa_codes$cbsa_code[1],
                             yr = "2020",
                             hud_key = hud_key)
il_cnty_dt <- get_hud_il_data(entityid = cnty_codes$fips_code[1],
                              yr = "2020",
                              hud_key = hud_key)

## End(Not run)

Get HUD Income Limit data at the State Level from HUD.

Description

Provides income limit data at the State level from HUD.

Usage

get_hud_il_statedata(entityid, yr, hud_key = Sys.getenv("HUD_API_KEY"))

Arguments

entityid

Character string containing the 'state_code' from get_hud_fmr_liststates(...).

yr

Character string indicating the year.

hud_key

Character string indicating your API key from HUD. Default is Sys.getenv("HUD_API_KEY").

Details

Provides income limit data at the State level from HUD.

Value

A list of data tables containing income limit data from HUD.

Author(s)

Paul Richardson

Examples

## Not run: 
library(hudr)

hud_key <- Sys.getenv("HUD_API_KEY")

state_codes <- get_hud_fmr_liststates(hud_key = hud_key)

il_state_dt <- get_hud_il_statedata(entityid = state_codes$state_code[1],
                                    yr = "2020",
                                    hud_key = hud_key)

## End(Not run)