Skip to content

Commit

Permalink
Merge pull request #43 from nhsbsa-data-analytics/42-multiple-address…
Browse files Browse the repository at this point in the history
…-improve

Improve multiple spaces catch in tidy_single_line_address
  • Loading branch information
ryanleggett authored Jun 11, 2024
2 parents 731975e + 0fa0171 commit b0483a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/tidy_single_line_address.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tidy_single_line_address <- function(df, col, remove_postcode = FALSE) {
"(\\d)(\\D)", "\\1 \\2"), # add a space between any digit followed by a non-digit (e.g. 1A becomes 1 A)
"(\\D)(\\d)", "\\1 \\2"), # add a space between any non-digit followed by a digit (e.g. A1 becomes A 1)
"&", " AND "), # replace the ampersand character with the string "and"
"( ){2,}", " "), # replace any multiple spaces with a single space
"s\\+", " "), # replace any multiple spaces with a single space
"([0-9]) - ([0-9])", "\\1-\\2")) # reconnect numbers separated by a hyphen
)
}

0 comments on commit b0483a6

Please sign in to comment.