Skip to contents

county_fips_lookup() uses a package-internal reference derived from the 2025 U.S. Census county adjacency file to translate between county names, state abbreviations, and 5-digit county FIPS identifiers.

Name lookups accept either the full county-equivalent label (for example, "Orleans Parish") or a shortened form with common suffixes removed (for example, "Orleans"). If a shortened form is ambiguous within a state, the function errors and asks for the full county-equivalent name or the 5-digit FIPS identifier.

Usage

county_fips_lookup(county, state = NULL)

Arguments

county

character, length one; either a county name or a 5-digit county FIPS identifier

state

character, length one; state abbreviation or full state name; required when county is a name, ignored when county is already a 5-digit FIPS identifier

Value

A tibble with one row and columns county, county_full, state, and county_fips.

Examples

county_fips_lookup("Hamilton", "OH")
#> # A tibble: 1 × 4
#>   county   county_full     state county_fips
#>   <chr>    <chr>           <chr> <chr>      
#> 1 Hamilton Hamilton County OH    39061      
county_fips_lookup("Hamilton", "Ohio")
#> # A tibble: 1 × 4
#>   county   county_full     state county_fips
#>   <chr>    <chr>           <chr> <chr>      
#> 1 Hamilton Hamilton County OH    39061      
county_fips_lookup("39061")
#> # A tibble: 1 × 4
#>   county   county_full     state county_fips
#>   <chr>    <chr>           <chr> <chr>      
#> 1 Hamilton Hamilton County OH    39061