This function is used to first normalize an abb and then call expand_abbrev() using valid_state and valid_name as the abb and rep arguments.

expand_state(abb)

Arguments

abb

A abb US state name character vector (e.g., "Vermont").

Value

The 2-letter USPS abbreviation of for state names (e.g., "VT").

See also

Other geographic normalization functions: abbrev_full(), abbrev_state(), check_city(), expand_abbrev(), fetch_city(), normal_address(), normal_city(), normal_state(), normal_zip(), str_normal()

Examples

expand_state(abb = state.abb)
#>  [1] "ALABAMA"        "ALASKA"         "ARIZONA"        "ARKANSAS"      
#>  [5] "CALIFORNIA"     "COLORADO"       "CONNECTICUT"    "DELAWARE"      
#>  [9] "FLORIDA"        "GEORGIA"        "HAWAII"         "IDAHO"         
#> [13] "ILLINOIS"       "INDIANA"        "IOWA"           "KANSAS"        
#> [17] "KENTUCKY"       "LOUISIANA"      "MAINE"          "MARYLAND"      
#> [21] "MASSACHUSETTS"  "MICHIGAN"       "MINNESOTA"      "MISSISSIPPI"   
#> [25] "MISSOURI"       "MONTANA"        "NEBRASKA"       "NEVADA"        
#> [29] "NEW HAMPSHIRE"  "NEW JERSEY"     "NEW MEXICO"     "NEW YORK"      
#> [33] "NORTH CAROLINA" "NORTH DAKOTA"   "OHIO"           "OKLAHOMA"      
#> [37] "OREGON"         "PENNSYLVANIA"   "RHODE ISLAND"   "SOUTH CAROLINA"
#> [41] "SOUTH DAKOTA"   "TENNESSEE"      "TEXAS"          "UTAH"          
#> [45] "VERMONT"        "VIRGINIA"       "WASHINGTON"     "WEST VIRGINIA" 
#> [49] "WISCONSIN"      "WYOMING"       
expand_state(abb = c("nm", "fr"))
#> [1] "NEW MEXICO" "FR"