I want to create 2 variables from 1 variable in R
.
I have following character variable for gas station:
station
Valero 1810 N Foster Rd & IH-10 E
from this variable I want to create 2: station_id
and address
station_id
Valero
address
1810 N Foster Rd & IH-10 E
In my data set all strings in station
variable begin with words (up to 3 words, eg: EZ Mart) and all addresses begin with numeric value.
I was trying to achieve this goal using gsub
for last couple hours but I couldn't do it.
Thank you