histnbmap {GeoXp} | R Documentation |
The function histnbmap()
draws the histogram of the distances between two neighbors for
a neighbourhood structure given by a nb
object and calculated by nbdists function (see spdep package),
and links the graphic with a map.
histnbmap(object, coords = NULL, longlat = NULL,sup=FALSE, nbcol=10, listvar=NULL,listnomvar=NULL,carte=NULL,criteria=NULL,label="",col="grey",pch=16, xlab="", ylab="", cex.lab=1, axes=FALSE, lablong="",lablat="")
object |
a object of class nb |
coords |
a matrix of size n x 2 |
longlat |
TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in kilometers; if coords is a SpatialPoints object, the value is taken from the object itself |
sup |
if TRUE, it keeps only the distance of the neighbor the farest |
nbcol |
number of cells for histogram (10 by default) |
listvar |
matrix of variables which permit to plot bubbles using the tk window |
listnomvar |
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 which permit to represent preselected sites with a cross, using the tcltk window |
label |
vector of character of size n with names of sites |
col |
color associated to the color of the histogram |
pch |
16 by default, symbol for selected points |
xlab |
a title for the graphic x-axis |
ylab |
a title for the graphic y-axis |
cex.lab |
character size of label |
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 neighbours. For a selected bar on the graph, the corresponding sites are represented on the map with a link which means that two sites are neighbours.
No value returned.
When user select 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.
Aragon Yves, Perrin Olivier, Ruiz-Gazen Anne, Thomas-Agnan Christine (2009), Statistique et Econométrie pour données géoréférencées : modèles et études de cas
moranplotmap
,makeneighborsw
,normw
,nonormmoran
example(columbus) coords <- coordinates(columbus) cont<-spdf2list(columbus)$poly histnbmap(col.gal.nb, coords ,carte=cont,listvar=columbus@data, listnomvar=names(columbus@data),criteria=which(coords[,1]>mean(coords[,1])), label=as.character(1:49),cex.lab=0.7,xlab="distance of the neighbor the farest", col='violet')