Open jeesunyun opened 3 years ago
observe({
proxy <- leafletProxy("mymap", data = df)
palette_testing = c("green", "red")
color1 <- colorFactor(palette=palette_testing, df$open_now)
proxy %>% clearControls()
# clear the map
leafletProxy("mymap", data = df) %>%
clearShapes() %>%
clearMarkers() %>%
addProviderTiles("CartoDB.Voyager") %>%
fitBounds(-74.354598, 40.919500, -73.761545, 40.520024)
# output data related to covid testing sites
if (input$covid_test){
leafletProxy("mymap", data = df) %>%
clearShapes() %>%
addProviderTiles("CartoDB.Voyager") %>%
addCircleMarkers(~lon, ~lat, radius=10,
color = ~color1(open_now),
label = paste(df$formatted_address, ', ', df$name),
popup = paste(
"<b>Name:</b>", df$name, "<br>",
"<b>Address:</b>", df$formatted_address, "<br>",
"<b>Rating:</b>", df$rating, "<br>",
"<b>Open now:</b>", df$open_now, "<br>")) %>%
addLegend("bottomright",
pal = color1,
values = df$open_now,
title = "Status",
opacity = 1)
}
})
Modifications/ Analysis Suggestions
@wanyexin
@MingyuanXia
COVID Vaccine data: choropleth map
Population Denominator
: data collected in 2019percent of fully vaxxed >100% probably account for population difference
reading html on web > will update automatically when load app
@jeesunyun