vacant_parcels<- parcels %>%
filter(MuniUseC_1 == "Commercial Ind Vct"|MuniUseC_1 == "Residential Vacant")
tax <- read_xlsx(excel_link)
properties <- tax %>%
mutate(parcelid=`Parcel ID`) %>%
filter(!is.na(parcelid))
nu_tax_parcels <- parcels %>% inner_join(properties, by=c("PROPID"="parcelid"))
tax_centroids <- st_centroid(nu_tax_parcels)
## Warning: st_centroid assumes attributes are constant over geometries
# Assuming vacant_parcels is your sf object ready for plotting
# Define a color palette
colorPalette <- colorFactor(palette = "Set1", domain = vacant_parcels$MuniUseC_1)
leaflet(vacant_parcels) %>%
addProviderTiles(provider = providers$CartoDB.Positron) %>%
addPolygons(fillColor = ~colorPalette(MuniUseC_1),
weight = 0,
opacity = 1,
color = "black",
fillOpacity = 0.7,
popup = ~paste(MuniUseC_1,"Address:", ParcAddres)) %>%
addCircleMarkers(data = tax_centroids,radius=5) %>%
addLegend("bottomright",
pal = colorPalette,
values = ~MuniUseC_1,
title = "Land Use",
opacity = 1)
leaflet() %>%
# Add tile layer
addProviderTiles(provider = providers$CartoDB.Positron) %>%
# Add centroids to the map
addCircleMarkers(data = tax_centroids, radius = 3, popup = ~paste(ParcAddres))
colorPalette <- colorFactor(palette = "Set3", domain = nu_tax_parcels$MuniUseC_1)
leaflet(nu_tax_parcels) %>%
addProviderTiles(provider = providers$CartoDB.Positron) %>%
addPolygons(fillColor = ~colorPalette(MuniUseC_1),
weight = 1,
opacity = .5,
color = "black",
fillOpacity = 0.7,
popup = ~paste(MuniUseC_1,"Address:", ParcAddres)) %>%
addLegend("bottomright",
pal = colorPalette,
values = ~MuniUseC_1,
title = "Land Use",
opacity = 1)
## Retrieving data for the year 2021
## | | | 0% | |==== | 6% | |======== | 12% | |============ | 18% | |==================== | 29% | |======================== | 35% | |============================ | 40% | |================================ | 46% | |============================================ | 63% | |==================================================== | 75% | |============================================================ | 86% | |================================================================ | 92% | |======================================================================| 100%
## Getting data from the 2017-2021 5-year ACS
## Downloading feature geometry from the Census website. To cache shapefiles for use in future sessions, set `options(tigris_use_cache = TRUE)`.
## | | | 0% | |= | 1% | |================================== | 49% | |========================================================= | 81% | |======================================================================| 100%
###production