12345678910111213141516171819202122232425262728 |
- library(shiny)
- library(leaflet)
- library(janitor)
- library(dplyr)
- library(readr)
-
- Geo2017 <- clean_names(read_csv("../data/AllDHBsGeocoded.csv"), case = "snake") %>%
- select(-facility_opening_date) %>%
- mutate(dhb_name = ifelse(is.na(dhb_name), "Missing", dhb_name),
- health_facility_code = ifelse(is.na(health_facility_code),
- "Missing", health_facility_code))
-
- ui <- fillPage(
- leafletOutput(outputId = "medmap", height = "100%")
- )
-
- server <- function(input, output) {
- output$medmap <- renderLeaflet({
- leaflet(Geo2017) %>%
- addTiles() %>%
- addMarkers(lng = Geo2017$lon,
- lat = Geo2017$lat,
- popup = Geo2017$name)
- })
- }
-
- # Run the application
- shinyApp(ui = ui, server = server)
|