When using normal_state() on a vector of 1 million state values, the vast majority will be valid abbreviations. The more efficient way is to normalize each unique invalid values.
- Look at
unique() state values
- Ignore the good values
- Normalize only the bad ones
- Match normalized values back
- Return a single vector
When using
normal_state()on a vector of 1 million state values, the vast majority will be valid abbreviations. The more efficient way is to normalize each unique invalid values.unique()state values