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:
Does the web page feature a date and is this date less than two months before the date that youโre grading this assignment?
Does the web page feature an interactive map that appears to have been created with Leaflet?
I plotted all the nearby restaurants and cafes near where I live in Makati, Philippines.
library(knitr)
## Warning: package 'knitr' was built under R version 3.5.3
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.5.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.5.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lat=14.5538270, lng=121.0144190, popup="Little Tokyo, Makati") %>%
addMarkers(lat=14.5520150,lng=121.0144390, popup="101 Hawker Foodhouse, Makati") %>%
addMarkers(lat=14.5512820,lng=121.0134050, popup="Starbucks, Makati") %>%
addMarkers(lat=14.5527140,lng=121.0162560, popup="Bondi&Burke, Makati") %>%
addMarkers(lat=14.5513700,lng=121.0140860, popup="Amici de Don Bosco, Makati") %>%
addMarkers(lat=14.5536140,lng=121.0139820, popup="Shinjuku Home of Authentic Ramen, Makati")
m
Here is a neat trick of mapping clusters, whenever you zoom in and out of the map.
df <- data.frame(lat=runif(500, min=14.55, max = 14.65),
lng=runif(500, min=121.05, max = 121.15 ))
df %>%
leaflet() %>%
addTiles() %>%
addMarkers(clusterOptions = markerClusterOptions())