Look up county or metropolitan area names by FIPS or CBSA codes. Looking up FIPS code is done with the first 2 numbers (state) or 5 numbers (county) and therefore can be called with longer FIPS codes.

state_fips_to_name(code)

county_fips_to_name(code)

cbsa_to_name(code)

Arguments

code

Vector of FIPS or CBSA codes to look up.

Value

A vector of state, county or metro names.

Examples

state_fips_to_name("42")
#>             42 
#> "Pennsylvania" 
state_fips_to_name("42003") # same as previous
#>             42 
#> "Pennsylvania" 
county_fips_to_name("42003")
#>              42003 
#> "Allegheny County" 
county_fips_to_name("42000") # the county "000" returns the state name
#>          42000 
#> "Pennsylvania" 
cbsa_to_name("38300")
#>            38300 
#> "Pittsburgh, PA"