neighbourmap {GeoXp} | R Documentation |
The function `neighbourmap' identifies spatial outliers by comparing a variable value for a particular site with these of its neighbouring sites. It draws a scatterplot of the values of the variable at neighbouring sites for a neighbourhood structure given by a binary weight matrix $W$ and links this scatterplot with a map.
neighbourmap(long, lat, var, W, id=FALSE, listvar=NULL, listnomvar=NULL, carte=NULL, criteria=NULL, label="", cex.lab=1, pch=16, col="blue", xlab="",ylab="", axes=FALSE, lablong="", lablat="")
long |
a vector $x$ of size $n$ |
lat |
a vector $y$ of size $n$ |
var |
a vector of numeric values of size $n$ |
W |
A spatial weigth matrix of size $n times n$ |
id |
If TRUE, drawing the linear curve y=x |
listvar |
matrix of variables which permit to plot bubbles on map or add a graphic using the tk window |
listnomvar |
a list with names of variables $listvar$ |
carte |
matrix with 2 columns for drawing spatial polygonal contours : $x$ and $y$ coordinates of the vertices of the polygon |
criteria |
a vector of size $n$ of boolean with TRUE on specific sites (these for non interactive selection) |
label |
a list of character of size $n$ with name of site. Names are printed on map after a selection |
cex.lab |
character size of label |
pch |
16 by default, choice of representation of selected points |
col |
"blue" by default, color of the points on the neighbor plot |
xlab |
a title for the graphic x-axis |
ylab |
a title for the graphic y-axis |
axes |
a boolean with TRUE for drawing axes on the map |
lablong |
name of the x-axis that will be printed on the map |
lablat |
name of the y-axis that will be printed on the map |
For a selected site $j$ on the map, are represented on the map its neighbors, and on the graph, on the x-axis the value of $var$ for this site, and in y-axis, the values of $var$ for the neighbouring sites of $j$. For a selected point on the graph, the corresponding pair of sites is represented on the map with a link.
Returns a matrix of size $n times n$ of boolean with TRUE if pair $(i,j)$ was in the last selection.
When user selects sites on the graph or on the map, he cannot add a selection by using the other graphic.
Aragon Y., Thomas-Agnan C., Ruiz-Gazen A., Laurent T., Robidou L.
Aragon Yves, Perrin Olivier, Ruiz-Gazen Anne, Thomas-Agnan Christine (2008), ``Statistique et Econométrie pour données géoréférencées : modèles et études de cas''
moranplotmap
,makeneighborsw
,normw
,nonormmoran
# data oldcol columbus <- readShapePoly(system.file("etc/shapes/columbus.shp", package="spdep")[1]) list.OLD <- spdf2list(columbus) contours.OLD <- list.OLD$poly x.OLD <- list.OLD$X y.OLD <- list.OLD$Y W <- makeneighborsw(x.OLD , y.OLD,method="neighbor",4) obs<-neighbourmap(x.OLD , y.OLD,columbus@data$CRIME, W,carte=contours.OLD, criteria=(columbus@data$CRIME>mean(columbus@data$CRIME)),listvar=columbus@data, listnomvar=names(columbus@data),id=TRUE,col="grey",pch=4)