7

State List map

While working on some of my data for my grad thesis, I have played around with how to best visualize data using the stats program R. This led from one thing to another, and surprise, I ended up making a graphic from my state life lists. This is just the tip of the iceberg of what I can probably do with this but here is the product of just a few hours work this evening. One thing is certain, I need to go back and enter some of my old lists because I know I have seen a lot more species in some of the states than this chart shows.

 

[cf]States[/cf]

  • http://abqbirding.wordpress.com Matt

    That’s so cool. I’ve used R in the past but my skills are pretty rusty. Where did you get the map from? Did you use the map() function? I wonder if you could expand this to counties easily. A GIS program would probably help with that.

    • http://nemesisbird.com Drew

      I used the googleVis library. I actually have GIS set up to take my lists from eBird and make some nice maps of counties. Check out the attached image.

      • Rtwillia

        Drew, would you share the code you used to identify the county borders in gvisGeoMap()?  Also, do you know of a way to map a single state and counties (or other arbitrary borders) within it?  Very curious about this. Thanks!

        • http://nemesisbird.com Drew

          The county map is all in ArcGIS. Unfortunately google doesn’t seem to have a good way to do counties with their tools so I haven’t found a way to do what you are looking for. 

  • http://twitter.com/blobbybirdman Mark Robinson, Ph.D

    This makes my bird nerd happy, any chance you would share the R code with lazier bird nerds?

    • http://nemesisbird.com Drew

      Mark, give this code a try. 
      # Google Chart Tools sample
      # install.packages(“googleVis”, dependencies=T)
      library(googleVis) # load googleVis library
      # demo(“googleVis”) #check out demo for lots of map options
      # create a csv with columns for state name (State) and life list(Life)

      df<-read.csv("states.csv", na.strings="NA",header=TRUE)

      ## Geo Map, requires Flash
      statelife <- gvisGeoMap(df, "State", "Life", options=list(region="US", dataMode="regions", width=700, height=500))

      plot(statelife)

  • http://twitter.com/andrewmcgann Andrew McGann

    Here’s to more posts utilizing Program R! Keep ’em coming, Drew. Thanks for posting the script too!