It’s no surprise that Chicago is one of the finest tourist destinations in the country. There are Chicago museums that rank among the world’s best, gorgeous parks in Chicago and some of the friendliest city-dwellers out there. With so much to see and do, it can be tough for visitors to decide which Chicago attractions are really worth experiencing.
This documents shows the top 6 attractions(based on the annual attendance from 2010) using the Leaflet package (for visualization) and R markdown (for documentation).
The data for this demonstration was collected from this source
library(leaflet)
chicagoData <- data.frame(lat = c(41.8825572, 41.879585, 41.920180, 41.887821,
41.86754105, 41.89187955),
lng = c(-87.6225003, -87.623711, -87.636390,
-87.613747, -87.6136862, -87.60413472),
col = c("Millenium Park", "Art Institute of Chicago",
"Lincoln Park Zoo", "Chicago Riverwalk",
"Shedd Aqaurium", "Navy Pier"),
pop = c(4.5, 1.8, 3, 2.8, 2.06, 8.69))
sites <- c()
The map shows the 6 most visited sites of Chicago. Zoom in to view individual sites of the clusters and click on the pop-up to view the population of that site.
chicagoData %>%
leaflet() %>%
addTiles() %>%
addMarkers(lat = chicagoData$lat, lng = chicagoData$lng,
popup = paste(chicagoData$col, "<br>", "Population(in millions):",
chicagoData$pop),
clusterOptions = markerClusterOptions()) %>%
addCircleMarkers(radius = chicagoData$pop * 5)
Assuming "lng" and "lat" are longitude and latitude, respectively