Learn R Programming

⚠️There's a newer version (1.4-2) of this package.Take me there.

spdep (version 0.1-6)

Spatial dependence: weighting schemes, statistics and models

Description

A collection of functions to create spatial weights matrix objects from polygon contiguities, from point patterns by distance and tesselations, for summarising these objects, and for permitting their use in spatial data analysis; a collection of tests for spatial autocorrelation, including global Moran's I, Geary's C, Hubert/Mantel general cross product statistic, and Getis/Ord G, local Moran's I and Getis/Ord G, saddlepoint approximations for global and local Moran's I; and functions for estimating spatial simultaneous autoregressive (SAR) models. Was formerly the three packages: spweights, sptests, and spsarlm.

Copy Link

Version

Install

install.packages('spdep')

Monthly Downloads

51,492

Version

0.1-6

License

GPL version 2 or newer

Maintainer

Roger Bivand

Last Published

February 13th, 2026

Functions in spdep (0.1-6)

knearneigh

K nearest neighbours for spatial weights
summary.sarlm

summary method for class sarlm
dnearneigh

Neighbourhood contiguity by distance
joincount

Count joins between same colours
eigenw

Spatial weights matrix eigenvalues
geary.mc

Permutation test for Geary's C statistic
joincount.test

BB join count statistic for k-coloured factors
include.self

Include self in neighbours list
lagsarlm

Spatial simultaneous autoregressive lag model estimation
errorsarlm

Spatial simultaneous autoregressive error model estimation
nblag

Higher order neighbours lists
summary.nb

Summary function for neighbours lists
Graph Components

Depth First Search on Neighbor Lists
localG

G and Gstar local spatial statistics
localmoran.sad

Saddlepoint approximation of local Moran's Ii tests
nbdists

Spatial link distance measures
diffnb

Differences between neighbours lists
write.nb.gal

Write a neighbours list as a GAL lattice file
LR.sarlm

Likelihood ratio test
invIrM

Compute SAR generating operator
joincount.mc

Permutation test for same colour join count statistics
graphneigh

Graph based spatial weights
knn2nb

Neighbours list from knn object
cell2nb

Generate neighbours list for grid cells
predict.sarlm

Prediction for spatial simultaneous autoregressive linear model objects
geary.test

Geary's C test for spatial autocorrelation
lag.listw

Spatial lag of a numeric vector
sp.correlogram

Spatial correlogram
nb2mat

Spatial weights matrices for neighbours lists
moran

Compute Moran's I
moran.plot

Moran scatterplot
geary

Compute Geary's C
read.gal

Read a GAL lattice file into a neighbours list
lm.LMtests

Lagrange Multiplier diagnostics for spatial dependence in linear models
globalG.test

test for spatial autocorrelation
moran.mc

Permutation test for Moran's I statistic
sp.mantel.mc

Mantel-Hubert spatial general cross product statistic
localmoran

Local Moran's I statistic
moran.test

Moran's I test for spatial autocorrelation
nb.set.operations

Set operations on neighborhood objects
listw2sn

Spatial neighbour sparse representation
poly2nb

Construct neighbours list from polygon list
tri2nb

Neighbours list from tri object
nb2listw

Spatial weights for neighbours lists
card

Cardinalities for neighbours lists
is.symmetric.nb

Test a neighbours list for symmetry
airdist

Measure distance from plot
edit.nb

Interactive editing of neighbours lists
plotpolys

Plot polygons
droplinks

Drop links in a neighbours list
plot.nb

Plot a neighbours list
lm.morantest

Moran's I test for residual spatial autocorrelation
spweights.constants

Provides constants for spatial weights matrices
lm.morantest.sad

Saddlepoint approximation of global Moran's I test
residuals.sarlm

Access functions for spatial simultaneous autoregressive linear model objects
subset.nb

Subset a neighbours list
boston

Corrected Boston Housing Data
oldcol

Columbus OH spatial analysis data set - old numbering
afcon

Spatial patterns of conflict in Africa 1966-78
columbus

Columbus OH spatial analysis data set
getisord

Getis-Ord remote sensing example data
nc.sids

North Carolina SIDS data
eire

Eire data sets
used.cars

US 1960 used car prices