Description Usage Arguments See Also Examples
The function takes a SpatialPolygonsDataFrame
and computes
the neighbor penalty matrix that can be used to fit a Markov
random field, e.g., using the smooth constructor
smooth.construct.mrf.smooth.spec
.
1 2 3 4 5 6 
x 
An object of class 
type 
Which type of neighborhood structure should be used,

k 
For 
id 
An identifier variable for which the penalty matrix should be computed. 
nb 
Should only the neighborhood object be returned. 
names 
Specifies the column where the regions names are provided in the data
slot in the 
add 
Should the neighborhood structure be added to an existing plot? 
... 
Arguments to be passed to function 
smooth.construct.mrf.smooth.spec
, dnearneigh
,
tri2nb
, knn2nb
.
1 2 3 4 5 6 7 8 9 10 11  data("LondonFire")
## Compute polygon boundary based
## neighborhood matrix.
nm < neighbormatrix(LondonBoroughs)
print(nm)
## Plot neighborhood structures.
plotneighbors(LondonBoroughs)
plotneighbors(LondonBoroughs, type = "delaunay")
plotneighbors(LondonBoroughs, type = "dist", d1 = 0, d2 = 0.15)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.