R code help- Turning column of state names to abbreviations
<p>I'm new to R and need help.</p>

<p>I need to make a function that will transform my column of state names into their appropriate abbreviations. I know that I am going to use state.abb(x, state.names) but am unsure how to do it. Any advice?</p>

<p>Thanks!</p>