Learn R Programming

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

spdep (version 0.1-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 Index, 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.

Copy Link

Version

Install

install.packages('spdep')

Monthly Downloads

51,492

Version

0.1-8

License

GPL version 2 or newer

Maintainer

Roger Bivand

Last Published

February 13th, 2026

Functions in spdep (0.1-8)

include.self

Include self in neighbours list
invIrM

Compute SAR generating operator
listw2sn

Spatial neighbour sparse representation
droplinks

Drop links in a neighbours list
globalG.test

test for spatial autocorrelation
write.nb.gal

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

Moran's I test for spatial autocorrelation
LR.sarlm

Likelihood ratio test
dnearneigh

Neighbourhood contiguity by distance
EBImoran.mc

Permutation test for empirical Bayes index
joincount.mc

Permutation test for same colour join count statistics
moran.mc

Permutation test for Moran's I statistic
lagsarlm

Spatial simultaneous autoregressive lag model estimation
tri2nb

Neighbours list from tri object
localmoran

Local Moran's I statistic
geary.test

Geary's C test for spatial autocorrelation
knearneigh

K nearest neighbours for spatial weights
moran.plot

Moran scatterplot
edit.nb

Interactive editing of neighbours lists
moran

Compute Moran's I
subset.nb

Subset a neighbours list
diffnb

Differences between neighbours lists
predict.sarlm

Prediction for spatial simultaneous autoregressive linear model objects
sp.correlogram

Spatial correlogram
geary

Compute Geary's C
lm.morantest

Moran's I test for residual spatial autocorrelation
plot.nb

Plot a neighbours list
lm.morantest.sad

Saddlepoint approximation of global Moran's I test
is.symmetric.nb

Test a neighbours list for symmetry
nb2listw

Spatial weights for neighbours lists
sp.mantel.mc

Mantel-Hubert spatial general cross product statistic
nbdists

Spatial link distance measures
joincount.test

BB join count statistic for k-coloured factors
lag.listw

Spatial lag of a numeric vector
joincount

Count joins between same colours
cell2nb

Generate neighbours list for grid cells
localmoran.sad

Saddlepoint approximation of local Moran's Ii tests
read.gal

Read a GAL lattice file into a neighbours list
geary.mc

Permutation test for Geary's C statistic
set.spChkOption

Control checking of spatial object IDs
graphneigh

Graph based spatial weights
lm.LMtests

Lagrange Multiplier diagnostics for spatial dependence in linear models
nblag

Higher order neighbours lists
nb.set.operations

Set operations on neighborhood objects
poly2nb

Construct neighbours list from polygon list
summary.sarlm

summary method for class sarlm
card

Cardinalities for neighbours lists
errorsarlm

Spatial simultaneous autoregressive error model estimation
localG

G and Gstar local spatial statistics
nb2mat

Spatial weights matrices for neighbours lists
spweights.constants

Provides constants for spatial weights matrices
summary.nb

Summary function for neighbours lists
residuals.sarlm

Access functions for spatial simultaneous autoregressive linear model objects
Graph Components

Depth First Search on Neighbor Lists
knn2nb

Neighbours list from knn object
plotpolys

Plot polygons
airdist

Measure distance from plot
eigenw

Spatial weights matrix eigenvalues
afcon

Spatial patterns of conflict in Africa 1966-78
nc.sids

North Carolina SIDS data
eire

Eire data sets
getisord

Getis-Ord remote sensing example data
oldcol

Columbus OH spatial analysis data set - old numbering
boston

Corrected Boston Housing Data
used.cars

US 1960 used car prices
BH

Belo Horizont 1994 homicide data
columbus

Columbus OH spatial analysis data set