This function is used to first normalize a full state name and then call abbrev_full() using valid_name and valid_state as the full and rep arguments.

abbrev_state(full)

Arguments

full

A full 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(), check_city(), expand_abbrev(), expand_state(), fetch_city(), normal_address(), normal_city(), normal_state(), normal_zip(), str_normal()

Examples

abbrev_state(full = state.name)
#>  [1] "AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DE" "FL" "GA" "HI" "ID" "IL" "IN" "IA"
#> [16] "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ"
#> [31] "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT" "VT"
#> [46] "VA" "WA" "WV" "WI" "WY"
abbrev_state(full = c("new mexico", "france"))
#> [1] "NM"     "FRANCE"