Let’s create a map that shows the Tour Eiffel in Paris.
To do that, let’s first load the library Leaflet.
installed.packages("leaflet")
## Package LibPath Version Priority Depends Imports LinkingTo Suggests
## Enhances License License_is_FOSS License_restricts_use OS_type Archs
## MD5sum NeedsCompilation Built
library(leaflet)
Create the map of Paris
my_map <- leaflet() %>%
addTiles()
Create a link to the office site of Eiffel Tour, which we could get relevant information.
EiffelTour <- c("<a href= 'http://www.toureiffel.paris' >Eiffel Tour</a>")
leaflet() %>%
addTiles() %>%
addMarkers(lat=48.858053, lng=2.294289, popup = EiffelTour)
Now if we click the blue icon on the map, it will display Eiffel Tour and the link.