
439Spatial Auto-Correlation and Auto-Regression
> xd$X1
[1] 9 7 10 18 17 19 14 17 16 4 2 3 16 8 16 13 15 3 13 14
> x1 <- as.ordered(cut(xd$X1, breaks=seq(0,20,2), include.lowest=TRUE))
> unclass(x1)
[1] 4 3 4 7 7 8 5 7 6 2 1 2 6 3 6 5 6 2 5 5
attr(,“levels”)
[1] “[0,2]” “(2,4]” “(6,8]” “(8,10]” “(12,14]” “(14,16]” “(16,18]”
[8] “(18,20]”
>
We see how each region is assigned a code from the numbers 1–8. Then we assign a gray tone
(darker for higher values) to each interval and plot the map of polygons according to the intervals
and color codes selected (Figure 13.6)
cols <- grey(seq(1,0.3,-0.1) )
plot(xp, col=cols[unclass(x1)], border = par(“fg”),
axes=T,xlim=c(-0.25,1) ...