Learn R Programming

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

spdep (version 0.4-8)

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, Empirical Bayes estimates and Assun��o/Reis Index, Getis/Ord G and multicoloured join count statistics, 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) lag and error models, weighted and unweighted SAR and CAR spatial regression models, semi-parametric and Moran eigenvector spatial filtering, GM SAR error models, and generalized spatial two stage least squares models.

Copy Link

Version

Install

install.packages('spdep')

Monthly Downloads

51,492

Version

0.4-8

License

GPL version 2 or newer

Maintainer

Roger Bivand

Last Published

February 13th, 2026

Functions in spdep (0.4-8)

oldcol

Columbus OH spatial analysis data set - old numbering
SpatialFiltering

Semi-parametric spatial filtering
bptest.sarlm

Breusch-Pagan test for spatial models
is.symmetric.nb

Test a neighbours list for symmetry
nb2listw

Spatial weights for neighbours lists
LR.sarlm

Likelihood ratio test
graphneigh

Graph based spatial weights
EBlocal

Local Empirical Bayes estimator
asMatrixCsrListw

Convert spatial weights list to CSR matrix form
choynowski

Choynowski probability map values
nbdists

Spatial link distance measures
invIrM

Compute SAR generating operator
huddersfield

Prevalence of respiratory symptoms
airdist

Measure distance from plot
geary.mc

Permutation test for Geary's C statistic
card

Cardinalities for neighbours lists
eigenw

Spatial weights matrix eigenvalues
globalG.test

test for spatial autocorrelation
lagsarlm

Spatial simultaneous autoregressive lag model estimation
sp.correlogram

Spatial correlogram
listw2sn

Spatial neighbour sparse representation
eire

Eire data sets
localmoran.sad

Saddlepoint approximation of local Moran's Ii tests
spweights.constants

Provides constants for spatial weights matrices
NY_data

New York leukemia data
p.adjustSP

Adjust local association measures' p-values
geary

Compute Geary's C
set.spChkOption

Control checking of spatial object IDs
read.gal

Read a GAL lattice file into a neighbours list
GMerrorsar

Spatial simultaneous autoregressive error model estimation by GMM
as_dgRMatrix_listw

Interface between Matrix class objects and weights lists
cell2nb

Generate neighbours list for grid cells
stsls

Generalized spatial two stage least squares
nb2lines

Use arc-type shapefiles for import and export of weights
afcon

Spatial patterns of conflict in Africa 1966-78
probmap

Probability mapping for rates
getisord

Getis-Ord remote sensing example data
lm.morantest.sad

Saddlepoint approximation of global Moran's I test
knearneigh

K nearest neighbours for spatial weights
spautolm

Spatial conditional and simultaneous autoregression model estimation
moran.mc

Permutation test for Moran's I statistic
nblag

Higher order neighbours lists
Graph Components

Depth First Search on Neighbor Lists
boston

Corrected Boston Housing Data
dnearneigh

Neighbourhood contiguity by distance
predict.sarlm

Prediction for spatial simultaneous autoregressive linear model objects
used.cars

US 1960 used car prices
spdep

Return package version number
subset.listw

Subset a spatial weights list
diffnb

Differences between neighbours lists
columbus

Columbus OH spatial analysis data set
nb2WB

Output spatial weights for WinBUGS
plot.nb

Plot a neighbours list
subset.nb

Subset a neighbours list
residuals.sarlm

Access functions for spatial simultaneous autoregressive linear model objects
nc.sids

North Carolina SIDS data
poly2nb

Construct neighbours list from polygon list
read.gwt2nb

Read and write spatial neighbour files
hopkins

Hopkins burnt savanna herb remains
moran.test

Moran's I test for spatial autocorrelation
write.nb.gal

Write a neighbours list as a GAL lattice file
joincount.test

BB join count statistic for k-coloured factors
moran.plot

Moran scatterplot
nb2blocknb

Block up neighbour list for location-less observations
summary.nb

Print and summary function for neighbours and weights lists
lm.LMtests

Lagrange Multiplier diagnostics for spatial dependence in linear models
mat2listw

Convert a square spatial weights matrix to a weights list object
tri2nb

Neighbours list from tri object
autocov_dist

Distance-weighted autocovariate
baltimore

House sales prices, Baltimore, MD 1978
localG

G and Gstar local spatial statistics
errorsarlm

Spatial simultaneous autoregressive error model estimation
anova.sarlm

Comparison of simultaneous autoregressive models
sp.mantel.mc

Mantel-Hubert spatial general cross product statistic
lag.listw

Spatial lag of a numeric vector
nb2mat

Spatial weights matrices for neighbours lists
EBImoran.mc

Permutation test for empirical Bayes index
ME

Moran eigenvector GLM filtering
joincount.multi

BB, BW and Jtot join count statistic for k-coloured factors
droplinks

Drop links in a neighbours list
similar.listw

Create symmetric similar weights lists
summary.sarlm

summary method for class sarlm
geary.test

Geary's C test for spatial autocorrelation
nb.set.operations

Set operations on neighborhood objects
edit.nb

Interactive editing of neighbours lists
include.self

Include self in neighbours list
moran

Compute Moran's I
knn2nb

Neighbours list from knn object
auckland

Marshall's infant mortality in Auckland dataset
joincount.mc

Permutation test for same colour join count statistics
localmoran

Local Moran's I statistic
EBest

Global Empirical Bayes estimator
lm.morantest

Moran's I test for residual spatial autocorrelation