This is the solution to the first project of the Developing Data Products course of the data science specialization offered by Johns Hopkins University in coursera. For this project, using the leaflet library in RStudio, locate on a map the five most popular Colombian cities among travelers, according to the viala web page, on the map, you can see the names of the cities ordered in ascending order, as they are located in the ranking mentioned above and you can also see the location of each city, so that when you click In the city location, the name of the city will appear, and if you click on this name, you will be able to access a web page that presents a tourist guide to the city.
Below you can see the code with which the map was created
library(leaflet)
lat <- c(4.598326,10.423561,6.252239,11.228152,3.454998)
lng <- c(-74.075209,-75.539000,-75.568250,-74.177355,-76.534631)
place_name <- c("Position 1: Bogotá","Position 2: Cartagena","Position 3: Medellín","Position 4: Santa Marta","Position 5: Cali")
colors <- c("blue","green","orange","red","black")
links_sites <- c("<a href='https://mapaturistico.net/colombia/bogota/'>Bogotá</a>",
"<a href='https://colombia.travel/es/cartagena-de-indias'>Cartagena</a>",
"<a href='https://colombia.travel/es/medellin'>Medellín</a>",
"<a href='https://visitsantamarta.com/?gclid=EAIaIQobChMI6Zfo6drX6gIVNfC1Ch2m4QqqEAAYASAAEgK7DfD_BwE'>Santa Marta</a>",
"<a href='https://mapaturistico.net/colombia/cali/'>Cali</a>")
my_map <- data.frame(lat,lng,place_name,colors,links_sites)
top5 <- my_map %>% leaflet() %>%
addTiles() %>%
addMarkers(lng = lng, lat =lat,popup = my_map$links_sites)%>%
addCircleMarkers(color = my_map$colors)%>%
addLegend("bottomright",colors = my_map$colors, labels = place_name)
top5
1- https://viajala.com.co/blog/los-10-destinos-mas-buscados-en-colombia
2- https://mapaturistico.net/colombia/bogota
3- https://colombia.travel/es/cartagena-de-indias
4- https://colombia.travel/es/medellin
5- https://visitsantamarta.com/?gclid=EAIaIQobChMI6Zfo6drX6gIVNfC1Ch2m4QqqEAAYASAAEgK7DfD_BwE
6- https://mapaturistico.net/colombia/cali/")