I've not been able to find a solution to a problem I'm dealing with in R. I have a data.frame with a column containing state and county separated by a space. The first two characters of every row in the column are the state. After the space, follows the county. I want to create two new columns with one being the state and the second being the county.
What I have:
VAR_A, VAR_B, ST_COUNTY
A, B, AZ MOVHAVE
A, B, NV ELKO
A, B, CA SAN BERNADINO
What I want:
VAR_A, VAR_B, ST,COUNTY
A, B, AZ, MOHAVE
A, B, NV, ELKO
A, B, CA, SAN BERNADINO
Let me know if anyone has some ideas on how to output a new data frame with the two new columns.
Thank you!