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.
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.5.1
myLatLong <- data.frame(name=c("My office Location","My home Location"),
id=c(40,30),
lat = c(40.7593755, 40.7132 ),
lng = c(-73.9799726, -74.0355525))
myIcon <- makeIcon(
iconUrl=ifelse(myLatLong$lat>37.39 ,"http://www.cisco.com/web/fw/i/logo-open-graph.gif","http://www.freeiconspng.com/uploads/village-house-by-rdevries--a-tarraced-village-house--23.png"),
iconWidth = 50, iconHeight = 50,
iconAnchorX = 30, iconAnchorY = 30
)
myLatLong %>%
leaflet() %>%
addTiles() %>%
addMarkers( popup=myLatLong$name,icon=myIcon ,label = c("Office Location","Home Location"),
labelOptions = labelOptions(noHide = T, direction = "bottom",
style = list(
"color" = "Blue",
"font-family" = "serif",
"font-style" = "italic",
"box-shadow" = "3px 3px rgba(0,0,0,0.25)",
"font-size" = "12px",
"border-color" = "rgba(0,0,0,0.5)"))) %>%
addCircles(weight = 1, radius = myLatLong$id * 30)
## Assuming "lng" and "lat" are longitude and latitude, respectively
## Assuming "lng" and "lat" are longitude and latitude, respectively