Geographic maps in R: Italy
2010-09-13
As suggested by this post, I created an Italian map
with the following R code using the sp package and the GADM maps
library(sp)
con <- url(“http://gadm.org/data/rda/ITA_adm1.RData”)
print(load(con))
close(con)
# giving random values to the Italian regions (1,2,3,5,1,2,3,4,5,…)
language <- rep(seq(1,5),4)
gadm$language <- as.factor(language)
# choosing colors
col = rainbow(length(levels(gadm$language)))
spplot(gadm, “language”, col.regions=col, main=“Italian Regions”)