This is very much a work in progress. I thought I’d post to get some general impressions and feedback.
Using rvest I was able to glean every birthplace of every NHL player ever. I then used ggmap to geocode the birthplaces and get the longitude and latitude, and finally leaflet to map them.
I got data on 7127 NHL players and unfotunately birthplace info was not available or the place of birth could not be found during geocoding for about 200. Of these, not many players had had substantial careers. I think I can fix these missing birthplaces / coordinates if I had time. There may also be some rogue birthplaces where the geocode has determined that a birthplace is in a completely wrong locale - but I think I caught most of those.
Here are some basic plots of the data. I’ve colored dots by the number of games played in the NHL. Red are those playing over 1000 games. Blue are those playing are 500-999 games, and green are the rest.
Do you see any patterns in the data? Canada seems to like hockey a lot.
Owen Nolan and Steve Thomas ! Norman Mann the only Yorkshireman to play in the NHL.
leaflet(data=tmp2, height="650px", width="100%") %>%
addCircles(lat = ~ lat, lng = ~ lon, color = ~cols(GPgroup), weight=3, opacity=1,
fillOpacity=0.6, radius=500, popup = popInfo) %>%
addTiles("http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png") %>%
setView(-2, 53, zoom=5)
Here is one of my major issues that illustrates my utter naivete with this sort of mapping. For every Akim Aliu (Nigeria) or Rick Chartraw (Venezuela), there are many, many people who are born in places like Montreal, Calgary, etc. Unfortunately, the way I’m doing this right now, the dots overlay each other completely - meaning that when you click on the dot to the bottom right of Jay Wells’ red dot you get Paul Szczechura’s dot and not fellow Brantford, Ontario, native Wayne Gretzky. I’m going to work on fixing that.
leaflet(data=tmp2, height="650px", width="100%") %>%
addCircles(lat = ~ lat, lng = ~ lon, color = ~cols(GPgroup), weight=3, opacity=1,
fillOpacity=0.6, radius=500, popup = popInfo) %>%
addTiles("http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png") %>%
setView(-80.26443, 43.13939, zoom=10)
Any feedback please get in touch - [twitter is probably easiest - @jalapic](https://twitter.com/jalapic).