|
@@ -0,0 +1,28 @@
|
|
1
|
+library(shiny)
|
|
2
|
+library(leaflet)
|
|
3
|
+library(janitor)
|
|
4
|
+library(dplyr)
|
|
5
|
+library(readr)
|
|
6
|
+
|
|
7
|
+Geo2017 <- clean_names(read_csv("../data/AllDHBsGeocoded.csv"), case = "snake") %>%
|
|
8
|
+ select(-facility_opening_date) %>%
|
|
9
|
+ mutate(dhb_name = ifelse(is.na(dhb_name), "Missing", dhb_name),
|
|
10
|
+ health_facility_code = ifelse(is.na(health_facility_code),
|
|
11
|
+ "Missing", health_facility_code))
|
|
12
|
+
|
|
13
|
+ui <- fillPage(
|
|
14
|
+ leafletOutput(outputId = "medmap", height = "100%")
|
|
15
|
+)
|
|
16
|
+
|
|
17
|
+server <- function(input, output) {
|
|
18
|
+ output$medmap <- renderLeaflet({
|
|
19
|
+ leaflet(Geo2017) %>%
|
|
20
|
+ addTiles() %>%
|
|
21
|
+ addMarkers(lng = Geo2017$lon,
|
|
22
|
+ lat = Geo2017$lat,
|
|
23
|
+ popup = Geo2017$name)
|
|
24
|
+ })
|
|
25
|
+}
|
|
26
|
+
|
|
27
|
+# Run the application
|
|
28
|
+shinyApp(ui = ui, server = server)
|