Yesterday, I saw hrbrmstr’s post about a weekly visualization contest and thought it was a terrific idea.
This week dataset is about drone reports in the USA.
I first wanted to map the number of sighting per state residents but someone had already done a nice post about it so I’ll try something different.
In a first time, I kept what was done by hrbrmstr to get the data.
Then I used the geocode function of the ggmap package to get the reported coordinates of the sightings
The Google Maps api having a limit of 2500 daily queries and the server response being slow, I applied the function on the unique locations city, state to accelerate the process.
With dplyr’s mutate, one can count the number of drones seen each week in each location. Finally, filter excludes the reports from Alaska or Hawai to focus on the mainland.
To lower the reliance on the Google Maps api, the final dataset is saved.
For the visualization, I plotted the location of the report on a map with the help of ggplot2
Then I wanted to use gganimate to see a weekly evolution but I had issues that I was unable to resolve on my Windows machine.