Learn R Programming

spdep (version 0.1-10)

plot.nb: Plot a neighbours list

Description

A function to plot a neighbours list given point coordinates to represent the region in two dimensions.

Usage

plot.nb(x, coords, col="black", points=TRUE, add=FALSE, ...)

Arguments

x
an object of class nb
coords
matrix of region point coordinates
col
plotting colour
points
(logical) add points to plot
add
(logical) add to existing plot
...
further graphical parameters as in par(..)

See Also

summary.nb

Examples

Run this code
data(columbus)
plot(col.gal.nb, coords)
title(main="GAL order 1 links with first nearest neighbours in red")
col.knn <- knearneigh(coords, k=1)
plot(knn2nb(col.knn), coords, add=TRUE, col="red", lty=2)

Run the code above in your browser using DataLab