My revised version included a title, legend name and call to coord_map. I followed the same process as the original challenge – downloaded the data from the Bureau of Labor Statistics and saved the relevant sheet as a csv.
m=ggplot(choropleth, aes(long, lat, group = group)) +
geom_polygon(aes(fill = rate_d), colour = alpha(“white”, 1/2), size = 0.2) +
geom_polygon(data = state_df, colour = “white”, fill = NA) +
scale_fill_brewer(pal = “PuRd”, name=”Rate”)
m + coord_map() + opts(title=”US Unemployment Data (2009)”)
Worked like a charm. Note that there are some known problems with this solution. Some additional mapping/data cleanup is required to get a complete view of the data set (which explains why Louisiana is missing). I thought it would be neat to animate the results. So I subcontracted out animation using Gimp to a local expert. He created the following – a quick attempt to illustrate the changes over time. It is not ideal, you kind of have to pick a point stare at it and watch for changes over time.
Incidentally, blogger does not support animated gifs directly,
so I added the image in Google docs and linked to it from there. This does not seem to work due to authentication issues. Uploaded it to Picasa and you can view it there instead.
I know that there is an R animation package, but was not sure of its applicability in this scenario. How would you create an animation that illustrates changes on a map over time?