So, I have a dataset with street addresses, they are formatted very differently. For example:
d <- c("street1234", "Street 423", "Long Street 12-14", "Road 18A", "Road 12 - 15", "Road 1/2")
From this I want to create two columns. 1. X: with street address and 2. Y: with number + everything that follows. Like this:
XY Street 1234 Street 423 Long Street 12-14 Road 18A Road 12 - 15 Road 1/2
So far I have tried strsplit and have performed some similar questions, for example: strsplit(d, split = "(?<=[a-zA-Z])(?=[0-9])", perl = T)) . I just can't find the correct regular expression.
Any help is greatly appreciated. Thank you in advance!
regex r strsplit
Jesse
source share