Skip to contents

FIPS - Get county names from county FIPS codes

Usage

fips2countyname(fips, includestate = c("ST", "Statename", "")[1])

Arguments

fips

vector of US Census FIPS codes for Counties (5 digits each). can be string or numeric, with or without leading zeroes.

includestate

can be ST, Statename, "", or TRUE to specify what if anything comes after county name and comma

Value

vector of county names, optionally with comma and 2-character abbreviation or full state name.

Details

NOTE THAT ISLAND AREAS WORK DIFFERENTLY SINCE THEIR FIPS ARE NOT QUITE LIKE COUNTY FIPS

  • FIRST 5 LETTERS OF FIPS ARE NOT THE UNIQUE "COUNTY" CODE IN Northern Mariana Islands

Examples

  # names of all counties in ME and NY
  fips2countyname(fips_counties_from_state_abbrev(c("ME", "NY")), includestate = "ST")
#>  [1] "Androscoggin County, ME" "Aroostook County, ME"   
#>  [3] "Cumberland County, ME"   "Franklin County, ME"    
#>  [5] "Hancock County, ME"      "Kennebec County, ME"    
#>  [7] "Knox County, ME"         "Lincoln County, ME"     
#>  [9] "Oxford County, ME"       "Penobscot County, ME"   
#> [11] "Piscataquis County, ME"  "Sagadahoc County, ME"   
#> [13] "Somerset County, ME"     "Waldo County, ME"       
#> [15] "Washington County, ME"   "York County, ME"        
#> [17] "Albany County, NY"       "Allegany County, NY"    
#> [19] "Bronx County, NY"        "Broome County, NY"      
#> [21] "Cattaraugus County, NY"  "Cayuga County, NY"      
#> [23] "Chautauqua County, NY"   "Chemung County, NY"     
#> [25] "Chenango County, NY"     "Clinton County, NY"     
#> [27] "Columbia County, NY"     "Cortland County, NY"    
#> [29] "Delaware County, NY"     "Dutchess County, NY"    
#> [31] "Erie County, NY"         "Essex County, NY"       
#> [33] "Franklin County, NY"     "Fulton County, NY"      
#> [35] "Genesee County, NY"      "Greene County, NY"      
#> [37] "Hamilton County, NY"     "Herkimer County, NY"    
#> [39] "Jefferson County, NY"    "Kings County, NY"       
#> [41] "Lewis County, NY"        "Livingston County, NY"  
#> [43] "Madison County, NY"      "Monroe County, NY"      
#> [45] "Montgomery County, NY"   "Nassau County, NY"      
#> [47] "New York County, NY"     "Niagara County, NY"     
#> [49] "Oneida County, NY"       "Onondaga County, NY"    
#> [51] "Ontario County, NY"      "Orange County, NY"      
#> [53] "Orleans County, NY"      "Oswego County, NY"      
#> [55] "Otsego County, NY"       "Putnam County, NY"      
#> [57] "Queens County, NY"       "Rensselaer County, NY"  
#> [59] "Richmond County, NY"     "Rockland County, NY"    
#> [61] "St. Lawrence County, NY" "Saratoga County, NY"    
#> [63] "Schenectady County, NY"  "Schoharie County, NY"   
#> [65] "Schuyler County, NY"     "Seneca County, NY"      
#> [67] "Steuben County, NY"      "Suffolk County, NY"     
#> [69] "Sullivan County, NY"     "Tioga County, NY"       
#> [71] "Tompkins County, NY"     "Ulster County, NY"      
#> [73] "Warren County, NY"       "Washington County, NY"  
#> [75] "Wayne County, NY"        "Westchester County, NY" 
#> [77] "Wyoming County, NY"      "Yates County, NY"       
   fips_counties_from_state_abbrev(c("AK", "LA"))
#>  [1] "02013" "02016" "02020" "02050" "02060" "02063" "02066" "02068" "02070"
#> [10] "02090" "02100" "02105" "02110" "02122" "02130" "02150" "02158" "02164"
#> [19] "02170" "02180" "02185" "02188" "02195" "02198" "02220" "02230" "02240"
#> [28] "02275" "02282" "02290" "22001" "22003" "22005" "22007" "22009" "22011"
#> [37] "22013" "22015" "22017" "22019" "22021" "22023" "22025" "22027" "22029"
#> [46] "22031" "22033" "22035" "22037" "22039" "22041" "22043" "22045" "22047"
#> [55] "22049" "22051" "22053" "22055" "22057" "22059" "22061" "22063" "22065"
#> [64] "22067" "22069" "22071" "22073" "22075" "22077" "22079" "22081" "22083"
#> [73] "22085" "22087" "22089" "22091" "22093" "22095" "22097" "22099" "22101"
#> [82] "22103" "22105" "22107" "22109" "22111" "22113" "22115" "22117" "22119"
#> [91] "22121" "22123" "22125" "22127"