Maps are fantastic and complicated all at the same time!
Maps are some of the richest visualizations around because they come with data built into them. That is, on top of whatever data you’re going to plot you are also probably going to view terrain, roads, state/country borders, city names or a host of other information that come with our geography.
This implicit richness only adds to challenge of creating a good map. Observe the following recent tweet for a silly example of how maps can be…difficult.
And there is no shortage of map data visualizations on the web, but all too often this is what we end up with:
Be sure to watch all 6 videos in this series.
The leaflet package is actually extremely rich and can basically enable (interactive) map visualizations as complex as you can imagine. Take some time to peruse the site for the leaflet R package:
Briefly explain what choropleths are useful for and how they’re different from the other ways in which leaflet can display data?
What do the names of your plotted data columns have to be?
helmet_icon <- makeIcon(iconUrl = "http://www.clker.com/cliparts/l/R/b/J/X/D/astronaut-helmet-md.png",
iconWidth = 15, iconHeight = 15)
# MAP
leaflet() %>%
addTiles() %>%
addMarkers(lng = jitter(space$Longitude, factor = 2), lat = jitter(space$Latitude,
factor = 2), icon = helmet_icon, popup = paste(space$Name, "<br>", "Birth Place: ",
space$Birth.Place, "<br>", "Birthday: ", space$Birth.Date, "<br>", "Gender: ",
space$Gender, "<br>", "Status: ", space$Status), label = paste(space$Name))
The above map plots data on NASA astronauts!