Create a web page using R Markdown that features a map created with Leaflet.
Host your webpage on either GitHub Pages, RPubs, or NeoCities.
Your webpage must contain the date that you created the document, and it must contain a map created with Leaflet. We would love to see you show off your creativity!
The rubric contains the following two questions:
library(leaflet)
my_map <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lat = 28.6129, lng = 77.2295, popup="India Gate, Delhi") %>%
addMarkers(lat = 28.5244, lng = 77.1855, popup="Qutb Minar, Delhi") %>%
addMarkers(lat = 28.6562, lng = 77.2410, popup="Red Fort, Delhi") %>%
addMarkers(lat = 28.5933, lng = 77.2507, popup="Humayun's Tomb, Delhi") %>%
addMarkers(lat = 28.6264, lng = 77.2089, popup="Gurudwara Bangla Sahib, Delhi") %>%
addMarkers(lat = 28.6127, lng = 77.2773, popup="Akshardham, Delhi") %>%
addMarkers(lat = 28.5495, lng = 77.2036, popup = "Hauz Khas, Delhi") %>%
addMarkers(lat = 28.6003, lng = 77.2268, popup = "Khan Market, Delhi")
my_map # display the map
When you zoom in to each cluster, the cluster will separate until you see the individual Markers!
set.seed(2020-06-13)
df <- data.frame(lat = runif(1000, min = 28.65, max = 28.75 ),
lng = runif(1000, min = 77.05, max = 77.15 ))
df %>%
leaflet() %>%
addTiles() %>%
addMarkers(clusterOptions = markerClusterOptions())