Skip to contents

This function queries the Fair Markets Rent API provided by US Department of Housing and Urban Development (HUD USER). Querying a state provides a list containing two datasets: one with FMR at a county level resolution and the other FMR at a metroarea level resolution. Querying a county or (core based statistical areas) cbsa will provide data at a zip code resolution if geographic identifiers are classified as a small area.

Usage

hud_fmr(
  query,
  year = format(Sys.Date() - 365, "%Y"),
  key = Sys.getenv("HUD_KEY"),
  to_tibble = getOption("rhud_use_tibble", FALSE)
)

Arguments

query

Can provide either a 5 digit FIPS code + 99999 at end, state abbreviation, or cbsa (core based statistical area) code.

year

Gets the year that this data was recorded. Can specify multiple years. Default is the previous year.

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.

Value

This function returns a dataframe or tibble containing Fair Markets Rent (FMR) data for a particular county, metroarea, or state. For county and msa level data, these measurements include the county_name, counties_msa, town_name, metro_status, metro_name, smallarea_status, basicdata, Efficiency, One-Bedroom, Two-Bedroom, Three-Bedroom, Four-Bedroom, and year for zip code level data if it considered a small area. Otherwise, data will be returned at the level of the queried county or metroarea. For state level data two dataframes will be returned. One for county level and the other for metroarea level data. These measurements will be the same as county/metroarea level data. For more details about these measurements, go to https://www.huduser.gov/portal/dataset/fmr-api.html.

Examples

if (FALSE) {

hud_fmr("VA", year=c(2021))

hud_fmr("5100199999", year=c(2021))

hud_fmr("METRO47900M47900", year=c(2018))
}