Skip to content

Instantly share code, notes, and snippets.

@markheckmann
Created December 4, 2009 00:49
Show Gist options
  • Save markheckmann/248740 to your computer and use it in GitHub Desktop.
Save markheckmann/248740 to your computer and use it in GitHub Desktop.
library(sp)
library(RColorBrewer)
# get spatial data for Germany on county level
con <- url("http://gadm.org/data/rda/DEU_adm3.RData")
print(load(con))
close(con)
# plot Germany with random colors
col = rainbow(length(levels(gadm$NAME_3)))
spplot(gadm, "NAME_3", col.regions=col, main="German Regions",
colorkey = FALSE, lwd=.4, col="white")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment