US State Standardization

Does anyone know of an existing function/package/API that i can explore for the below.
I need to convert a string to a US State code.
I've been using fuzzy matching (amatch) using state.name & state.abb but the variations coming in that need to be standardized to a 2 character state code are all over the board.
Before I start diving into Greps I wanted to see if anyone already knows of a solution before I reinvent the wheel

example....

The State of CA
California State of
Incorporated in the state of california
(California)
Apple Computers is incorporated in the state of California

Thanks,
Jarrod

Check out this stack overflow thread:

R actually has two built-in datasets that should make it less painful.

Depending on your use-case, you might also look into some NLP packages that do Named Entity Recognition, specifically for places:

2 Likes

Thank you again Mara.

Your help is always appreciated.

Jarrod Brown

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.