Add unit numbers and rename label to address_1 in mailing export
All checks were successful
Deploy stAndrews / deploy (push) Successful in 5s
All checks were successful
Deploy stAndrews / deploy (push) Successful in 5s
This commit is contained in:
8
app.R
8
app.R
@@ -427,15 +427,17 @@ server <- function(input, output) {
|
||||
prep_mailing <- function(data) {
|
||||
data |>
|
||||
sf::st_drop_geometry() |>
|
||||
dplyr::select(owner_1, owner_2, label) |>
|
||||
dplyr::select(owner_1, owner_2, label, unit) |>
|
||||
dplyr::mutate(
|
||||
owner_2 = dplyr::na_if(owner_2, "NA"),
|
||||
owner_2 = ifelse(is.na(owner_2), "", owner_2),
|
||||
label = stringr::str_squish(label),
|
||||
address_1 = stringr::str_squish(label),
|
||||
address_2 = ifelse(unit == "", "", paste0("Unit ", unit)),
|
||||
city = "Venice",
|
||||
state = "FL",
|
||||
zip = "34285"
|
||||
)
|
||||
) |>
|
||||
dplyr::select(owner_1, owner_2, address_1, address_2, city, state, zip)
|
||||
}
|
||||
|
||||
output$download_filtered <- downloadHandler(
|
||||
|
||||
@@ -46,9 +46,11 @@ owners_raw <-
|
||||
mutate(
|
||||
# extract clean street address (before multiple spaces / unit suffix)
|
||||
label = str_trim(str_extract(situs_address, "^\\d+\\s+\\S+\\s+\\S+")),
|
||||
unit = str_trim(str_extract(situs_address, "\\d+\\s*$")),
|
||||
unit = ifelse(is.na(unit), "", unit),
|
||||
location = paste0(label, ", Venice FL")
|
||||
) |>
|
||||
select(account_number, owner_1, owner_2, subdivision, homestead, label, location)
|
||||
select(account_number, owner_1, owner_2, subdivision, homestead, label, unit, location)
|
||||
|
||||
# join to geometry ----
|
||||
owners <- owners_raw |>
|
||||
|
||||
Reference in New Issue
Block a user