Learn R Programming

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

spdep (version 0.4-2)

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

35,987

Version

0.4-2

License

GPL version 2 or newer

Maintainer

Roger Bivand

Last Published

August 31st, 2025

Functions in spdep (0.4-2)

NY_data

New York leukemia data
nbdists

Spatial link distance measures
moran

Compute Moran's I
as_dgRMatrix_listw

Interface between Matrix class objects and weights lists
SpatialFiltering

Semi-parametric spatial filtering
ME

Moran eigenvector GLM filtering
nb2WB

Output spatial weights for WinBUGS
summary.nb

Print and summary function for neighbours and weights lists
poly2nb

Construct neighbours list from polygon list
moran.test

Moran's I test for spatial autocorrelation
nb2lines

Use arc-type shapefiles for import and export of weights
edit.nb

Interactive editing of neighbours lists
asMatrixCsrListw

Convert spatial weights list to CSR matrix form
plot.nb

Plot a neighbours list
Graph Components

Depth First Search on Neighbor Lists
set.spChkOption

Control checking of spatial object IDs
airdist

Measure distance from plot
eigenw

Spatial weights matrix eigenvalues
choynowski

Choynowski probability map values
baltimore

House sales prices, Baltimore, MD 1978
stsls

Generalized spatial two stage least squares
errorsarlm

Spatial simultaneous autoregressive error model estimation
joincount.test

BB join count statistic for k-coloured factors
LR.sarlm

Likelihood ratio test
lagsarlm

Spatial simultaneous autoregressive lag model estimation
EBest

Global Empirical Bayes estimator
joincount.multi

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

Spatial weights for neighbours lists
droplinks

Drop links in a neighbours list
tri2nb

Neighbours list from tri object
card

Cardinalities for neighbours lists
localG

G and Gstar local spatial statistics
GMerrorsar

Spatial simultaneous autoregressive error model estimation by GMM
autocov_dist

Distance-weighted autocovariate
include.self

Include self in neighbours list
p.adjustSP

Adjust local association measures' p-values
subset.nb

Subset a neighbours list
geary.test

Geary's C test for spatial autocorrelation
globalG.test

test for spatial autocorrelation
lm.morantest

Moran's I test for residual spatial autocorrelation
geary.mc

Permutation test for Geary's C statistic
bptest.sarlm

Breusch-Pagan test for spatial models
lm.LMtests

Lagrange Multiplier diagnostics for spatial dependence in linear models
read.gwt2nb

Read and write spatial neighbour files
joincount.mc

Permutation test for same colour join count statistics
knearneigh

K nearest neighbours for spatial weights
localmoran

Local Moran's I statistic
EBImoran.mc

Permutation test for empirical Bayes index
invIrM

Compute SAR generating operator
knn2nb

Neighbours list from knn object
EBlocal

Local Empirical Bayes estimator
anova.sarlm

Comparison of simultaneous autoregressive models
nb2blocknb

Block up neighbour list for location-less observations
eire

Eire data sets
huddersfield

Prevalence of respiratory symptoms
mat2listw

Convert a square spatial weights matrix to a weights list object
predict.sarlm

Prediction for spatial simultaneous autoregressive linear model objects
similar.listw

Create symmetric similar weights lists
localmoran.sad

Saddlepoint approximation of local Moran's Ii tests
sp.mantel.mc

Mantel-Hubert spatial general cross product statistic
nb2mat

Spatial weights matrices for neighbours lists
is.symmetric.nb

Test a neighbours list for symmetry
oldcol

Columbus OH spatial analysis data set - old numbering
spautolm

Spatial conditional and simultaneous autoregression model estimation
moran.mc

Permutation test for Moran's I statistic
lag.listw

Spatial lag of a numeric vector
read.gal

Read a GAL lattice file into a neighbours list
diffnb

Differences between neighbours lists
subset.listw

Subset a spatial weights list
dnearneigh

Neighbourhood contiguity by distance
nb.set.operations

Set operations on neighborhood objects
geary

Compute Geary's C
listw2sn

Spatial neighbour sparse representation
spdep

Return package version number
spweights.constants

Provides constants for spatial weights matrices
graphneigh

Graph based spatial weights
nblag

Higher order neighbours lists
lm.morantest.sad

Saddlepoint approximation of global Moran's I test
probmap

Probability mapping for rates
moran.plot

Moran scatterplot
auckland

Marshall's infant mortality in Auckland dataset
afcon

Spatial patterns of conflict in Africa 1966-78
write.nb.gal

Write a neighbours list as a GAL lattice file
boston

Corrected Boston Housing Data
sp.correlogram

Spatial correlogram
used.cars

US 1960 used car prices
hopkins

Hopkins burnt savanna herb remains
cell2nb

Generate neighbours list for grid cells
residuals.sarlm

Access functions for spatial simultaneous autoregressive linear model objects
getisord

Getis-Ord remote sensing example data
localmoran.exact

Exact local Moran's Ii tests
aggregate.nb

Aggregate a spatial neighbours object
summary.sarlm

summary method for class sarlm
nc.sids

North Carolina SIDS data
columbus

Columbus OH spatial analysis data set
lm.morantest.exact

Exact global Moran's I test
prunecost

Compute cost of prune each edge
ssw

Compute the sum of dissimilarity
aple.mc

Approximate profile-likelihood estimator (APLE) permutation test
aple.plot

Approximate profile-likelihood estimator (APLE) scatterplot
bhicv

Data set with 4 life condition indices of Belo Horizonte region
aple

Approximate profile-likelihood estimator (APLE)
nbcosts

Compute cost of edges
plot.skater

Plot the object of skater class
mstree

Find the minimal spanning tree
skater

Spatial 'K'luster Analysis by Tree Edge Removal
prunemst

Prune a Minimun Spanning Tree
wheat

Mercer and Hall wheat yield data
plot.mst

Plot the Minimum Spanning Tree