Displaying 1 result from an estimated 1 matches for "tza_adm2".
2011 Nov 16
1
HELP DATA CLIPPING AND DATA OVERLAY ON A MAP
...#######
library(RColorBrewer)
library(RColorBrewer)
library(sp)
require(foreign)
require(latticeExtra)
reguire(lattice)
#Example data
lat <- seq(-12, -1, 0.1)
lon <- seq(28, 45, 0.1)
data <- expand.grid(lat=lat, lon=lon)
n <- nrow(data)
data$X <- runif(n, 0, 250)
#Read map boundaries
TZA_adm2 <- url("http://gadm.org/data/rda/TZA_adm2.RData")
print(load(TZA_adm2))
close(TZA_adm2)
col = rainbow(length(levels(gadm$NAME_2)))
spplot(gadm, "NAME_2", col.regions=col, auto.key = FALSE, main="TZA Regions")
#How do I clipp or overaly X in data on TZA_adm2 polygon?...