NHL Stadium Locations
As part of the Data Science Specialization offered by John Hopkins through Coursera, I have a project to create an ‘interactive map’ in a rmarkdown post. I figured I should map where the NHL stadiums are.
We’ll start by downloading the locations of all of the stadiums. There’s a github with these locations. Although the data is possibly a bit out of date (Edmonton has a new stadium, for example), there is a list of locations available on github. We’ll download that, convert from JSON to a data frame, then plot them with leaflet, an R package wrapper of a javascript tool by the same name.
The locations aren’t laid out in a simple to process (or simple to convert to data frame) format, so we’ll clean the data a bit.
With the data ready, we can build our map. It’s quite simple.
I’ll note, however, that getting leaflet maps to show on github pages is not easy. So you can view it on RPubs here: http://rpubs.com/pbulsink/arenamap.