Skip to content

Instantly share code, notes, and snippets.

@jlowin
Created November 13, 2009 03:03
Show Gist options
  • Save jlowin/233555 to your computer and use it in GitHub Desktop.
Save jlowin/233555 to your computer and use it in GitHub Desktop.
choropleth maps code
library(maps)
#align data with map definitions
mapnames <- map("county",plot=FALSE)[4]$names
colorsmatched <- unemp_data$colorBuckets [match(mapnames ,unemp_data$counties)]
#draw map
map("county",col = colors[unemp_data$colorBuckets[match(mapnames ,unemp_data$counties)]],fill = TRUE,resolution = 0,lty = 0,projection = "polyconic")
map("state",col = "white",fill=FALSE,add=TRUE,lty=1,lwd=1,projection="polyconic")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment