我有一个房产的地址,它被分成了许多字段。对于公寓(公寓)的房产,街道名称和编号的格式不理想,无法与其他信息匹配:
Address1 <- c("76", "Flat 2", "Flat 4")
Address2 <- c("Acacia Avenue", "Hightown, 23", "London Road, 34A")
# Not ideal for flats
print(paste(Address1, Address2))
Address3 < -c("Acacia Avenue", "23, Hightown", "34A, London Road")
# Better for flats
print(paste(Address1, Address3))
我想做的是将属性“编号”从街道名称的末尾移到开头。
我觉得规则是这样的:
looking at the end of the string:
is there a ", " followed by a number or a number plus a single character?
if so then move the contents after the "," to the start of the string.
1条答案
按热度按时间euoag5mw1#
下面是一个例子: