spdep
1.4-2Spatial Dependence: Weighting Schemes, Statistics
Overview
A collection of functions to create spatial weights matrix objects from polygon 'contiguities', from point patterns by distance and tessellations, for summarizing these objects, and for permitting their use in spatial data analysis, including regional aggregation by minimum spanning tree; a collection of tests for spatial 'autocorrelation', including global 'Morans I' and 'Gearys C' proposed by 'Cliff' and 'Ord' (1973, ISBN: 0850860369) and (1981, ISBN: 0850860814), 'Hubert/Mantel' general cross product statistic, Empirical Bayes estimates and 'Assunção/Reis' (1999) doi:10.1002/(SICI)1097-0258(19990830)18:16%3C2147::AID-SIM179%3E3.0.CO;2-I Index, 'Getis/Ord' G ('Getis' and 'Ord' 1992) doi:10.1111/j.1538-4632.1992.tb00261.x and multicoloured join count statistics, 'APLE' ('Li et al.' ) doi:10.1111/j.1538-4632.2007.00708.x, local 'Moran's I', 'Gearys C' ('Anselin' 1995) doi:10.1111/j.1538-4632.1995.tb00338.x and 'Getis/Ord' G ('Ord' and 'Getis' 1995) doi:10.1111/j.1538-4632.1995.tb00912.x, 'saddlepoint' approximations ('Tiefelsdorf' 2002) doi:10.1111/j.1538-4632.2002.tb01084.x and exact tests for global and local 'Moran's I' ('Bivand et al.' 2009) doi:10.1016/j.csda.2008.07.021 and 'LOSH' local indicators of spatial heteroscedasticity ('Ord' and 'Getis') doi:10.1007/s00168-011-0492-y. The implementation of most of these measures is described in 'Bivand' and 'Wong' (2018) doi:10.1007/s11749-018-0599-x, with further extensions in 'Bivand' (2022) doi:10.1111/gean.12319. 'Lagrange' multiplier tests for spatial dependence in linear models are provided ('Anselin et al'. 1996) doi:10.1016/0166-0462(95)02111-6, as are 'Rao' score tests for hypothesised spatial 'Durbin' models based on linear models ('Koley' and 'Bera' 2023) doi:10.1080/17421772.2023.2256810. Additions in 2024 include Local Indicators for Categorical Data based on 'Carrer et al.' (2021) doi:10.1016/j.jas.2020.105306 and 'Bivand et al.' (2017) doi:10.1016/j.spasta.2017.03.003; also Weighted Multivariate Spatial Autocorrelation Measures ('Bavaud' 2024) doi:10.1111/gean.12390. doi:10.1080/17421772.2023.2256810. A local indicators for categorical data (LICD) implementation based on 'Carrer et al.' (2021) doi:10.1016/j.jas.2020.105306 and 'Bivand et al.' (2017) doi:10.1016/j.spasta.2017.03.003 was added in 1.3-7. Multivariate 'spatialdelta' ('Bavaud' 2024) doi:10.1111/gean.12390 was added in 1.3-13 ('Bivand' 2025 doi:10.26034/la.cdclsl.2025.8343). From 'spdep' and 'spatialreg' versions >= 1.2-1, the model fitting functions previously present in this package are defunct in 'spdep' and may be found in 'spatialreg'.
- robustness checks on
licd_multi, updatehotspotmethod forlicd_multioutput - add
hotspotmethod forlocal_joincount_uni
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-07
- OK13 OK2026-05-05
Show 9 earlier changesHide 9 earlier changes
- ERROR12 OK, 1 ERROR2026-05-04
- OK13 OK2026-05-03
- ERROR12 OK, 1 ERROR2026-04-30
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-04-20
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
- NOTE11 OK, 3 NOTE2026-04-14
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-13
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 100
- Examples that run
- 94%88 run in a plain check · 2 only when donttest examples are enabled (R CMD check --as-cran) · 2 never run · 2 hold no code
- Exported functions with examples
- 97%
- Documented parameters
- 97%
- Return-value docs
- 96%
- Help pages citing references
- 58%
Downloads
Repository
- PRs merged (all time)
- 78%
- Median days to close, 50 most recently updated closed issues
- 29
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
4 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/r-spatial/spdep on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing spdep adds 12 packages (10 with compiled code, 25 MB of source tarballs). Heaviest: sf 9.3 MB, sp 4.3 MB, spData 3.6 MB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 50 more dependents and 59 packages that suggest it on CRAN ↗
Code & Tests
Datasets
People & History
Show 25 more contributorsHide 25 contributors
Show 8 of 9 peopleHide 8 people
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 3.0.3Latest
- 3.0.2
- RR 3.0.0 released · 2013-04-03
Show 208 earlier eventsHide 208 earlier events
- 2.15.32013-01-11 · diff ↗
- 2.15.22012-09-25 · diff ↗
- 2.15.12012-05-06 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 2.15.02012-03-14 · diff ↗
- 2.14.12011-11-26 · diff ↗
- RR 2.14.0 released · 2011-10-31
- 2.13.22011-09-16 · diff ↗
- 2.13.12011-06-29 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 2.13.02011-04-12 · diff ↗
- 2.12.1
- RR 2.12.0 released · 2010-10-15
- 2.12.0
- 2.11.12010-05-31 · diff ↗
- RR 2.11.0 released · 2010-04-22
- 2.11.02010-04-02 · diff ↗
- 2.10.12009-12-14 · diff ↗ ·
removed 7 exports
Hausman.sarlm, impacts.sarlm, print.sarlmImpact, summary.sarlmImpact, print.summary.sarlmImpact, plot.sarlmImpact, HPDinterval.sarlmImpactadded 2 exports
Hausman.test, impacts - RR 2.10.0 released · 2009-10-26
- 2.10.02009-10-16 · diff ↗
- 2.9.2
- RR 2.9.0 released · 2009-04-17
- 2.9.02009-01-21 · diff ↗
- 2.8.12008-10-24 · diff ↗ ·
added 14 exports
aggregate.nb, mstree, nbcosts, nbcost, plot.mst, plot.skater, prunecost, ssw, prunemst, skater, aple, aple.mc, aple.plot, localAple - RR 2.8.0 released · 2008-10-20
- 2.7.22008-06-27 · diff ↗
- 2.7.12008-05-14 · diff ↗
- RR 2.7.0 released · 2008-04-22
- 2.7.02008-03-25 · diff ↗
- 2.6.22007-12-29 · diff ↗
- 2.6.12007-11-01 · diff ↗
- RR 2.6.0 released · 2007-10-03
- 2.6.02007-09-18 · diff ↗
- 2.5.12007-06-09 · diff ↗
- RR 2.5.0 released · 2007-04-24
- 2.5.02007-03-26 · diff ↗
- 2.4.12006-11-13 · diff ↗
- RR 2.4.0 released · 2006-10-03
- 2.4.02006-09-05 · diff ↗
- 2.3.12006-05-20 · diff ↗
- RR 2.3.0 released · 2006-04-24
- 2.3.02006-03-08 · diff ↗
- 2.2.12005-12-15 · diff ↗ ·
added 24 exports
spautolm, residuals.spautolm, deviance.spautolm, coef.spautolm, fitted.spautolm, print.spautolm, summary.spautolm, LR1.spautolm, logLik.spautolm, print.summary.spautolm, autocov_dist, GMerrorsar, residuals.gmsar, deviance.gmsar, coef.gmsar, fitted.gmsar, print.gmsar, summary.gmsar, LR1.gmsar, logLik.gmsar, print.summary.gmsar, SpatialFiltering, print.SFResult, fitted.SFResult - RR 2.2.0 released · 2005-10-06
- 2.1.12005-04-19 · diff ↗
- RR 2.1.0 released · 2005-04-18
- 2.1.02005-03-08 · diff ↗
- RR 2.0.0 released · 2004-10-04
- 2.0.02004-08-07 · diff ↗
- 1.4-22026-02-13 · diff ↗
- 1.4-12025-08-31 · diff ↗
- 1.3-132025-06-10 · diff ↗ ·
added 13 exports
spatialdelta, linearised_diffusive_weights, metropolis_hastings_weights, iterative_proportional_fitting_weights, graph_distance_weights, plot_spatialcoords, plot_moran, plot_spatialscree, localdelta, factorial_coordinates, plot_factorialcoords, plot_factorialscree, cornish_fisher - 1.3-11
- 1.3-102025-01-20 · diff ↗
- 1.3-92025-01-16 · diff ↗
- 1.3-82024-12-02 · diff ↗
- 1.3-7
- 1.3-62024-09-13 · diff ↗ ·
added 9 exports
addlinks1, read.swmdbf2listw, read_swm_dbf, write.sn2DBF, get.SubgraphCeiling, set.SubgraphCeiling, get.NoNeighbourOption, set.NoNeighbourOption, licd_multi - 1.3-52024-06-10 · diff ↗
- 1.3-42024-05-31 · diff ↗
- 1.3-3
- 1.3-12023-11-23 · diff ↗ ·
removed 4 exports
print.nb, summary.nb, summary.listw, print.listwadded 2 exports
get.SubgraphOption, set.SubgraphOption - 1.2-8
- 1.2-72022-10-01 · diff ↗ ·
added 5 exports
hotspot, localmoran_bv, moran_bv, local_joincount_uni, local_joincount_bv - 1.2-52022-08-12 · diff ↗
- 1.2-4
- 1.2-32022-03-29 · diff ↗
- 1.2-22022-01-29 · diff ↗
- 1.2-12022-01-05 · diff ↗ ·
removed 105 exports
invIrM, invIrW, aple, aple.mc, aple.plot, localAple, errorsarlm, lagsarlm, sacsarlm, print.sarlm, summary.sarlm, residuals.sarlm, deviance.sarlm, coef.sarlm, fitted.sarlm, logLik.sarlm, anova.sarlm, vcov.sarlm, predict.sarlm, print.summary.sarlm, print.sarlm.pred, bptest.sarlm, lmSLX, create_WX, predict.SLX, spBreg_lag, spBreg_err, spBreg_sac, spautolm, residuals.spautolm and 75 more - 1.1-13
- 1.1-122021-11-09 · diff ↗
- 1.1-112021-09-07 · diff ↗
- 1.1-8
- 1.1-7
- 1.1-52020-06-29 · diff ↗
- 1.1-32019-09-18 · diff ↗
- 1.1-22019-04-05 · diff ↗
- 1.0-2
- 0.8-1
- 0.7-92018-09-28 · diff ↗
- 0.7-82018-08-15 · diff ↗
- 0.7-7
- 0.7-42017-11-22 · diff ↗
- 0.6-152017-09-01 · diff ↗
- 0.6-132017-04-25 · diff ↗
- 0.6-122017-04-06 · diff ↗
- 0.6-112017-02-23 · diff ↗
- 0.6-10
- 0.6-92017-01-09 · diff ↗
- 0.6-82016-09-21 · diff ↗
- 0.6-6
- 0.6-52016-06-02 · diff ↗
- 0.6-42016-04-12 · diff ↗
- 0.5-922015-12-22 · diff ↗
- 0.5-882015-03-17 · diff ↗
- 0.5-872015-03-16 · diff ↗
- 0.5-86
- 0.5-832015-01-16 · diff ↗
- 0.5-822015-01-07 · diff ↗
- 0.5-812015-01-06 · diff ↗
- 0.5-77
- 0.5-74
- 0.5-712014-01-31 · diff ↗
- 0.5-682013-11-04 · diff ↗ ·
removed 2 exports
get.rlecuyerSeedOption, set.rlecuyerSeedOptionadded 5 exports
set.mcOption, get.mcOption, set.coresOption, get.coresOption, intImpacts - 0.5-652013-09-16 · diff ↗
- 0.5-642013-09-02 · diff ↗
- 0.5-63
- 0.5-622013-08-07 · diff ↗
- 0.5-612013-07-24 · diff ↗
- 0.5-602013-07-02 · diff ↗
- 0.5-572013-06-21 · diff ↗
- 0.5-562013-01-11 · diff ↗
- 0.5-55
- 0.5-532012-11-09 · diff ↗
- 0.5-52
- 0.5-51
- 0.5-50
- 0.5-462012-05-06 · diff ↗
- 0.5-452012-03-18 · diff ↗
- 0.5-432011-11-27 · diff ↗
- 0.5-412011-11-14 · diff ↗
- 0.5-40
- 0.5-372011-06-29 · diff ↗
- 0.5-352011-06-09 · diff ↗
- 0.5-332011-05-20 · diff ↗
- 0.5-32
- 0.5-31
- 0.5-292011-03-14 · diff ↗
- 0.5-262010-11-30 · diff ↗
- 0.5-242010-10-09 · diff ↗
- 0.5-21
- 0.5-19
- 0.5-172010-07-31 · diff ↗
- 0.5-16
- 0.5-142010-06-23 · diff ↗
- 0.5-112010-06-03 · diff ↗
- 0.5-102010-05-30 · diff ↗
- 0.5-92010-05-19 · diff ↗ ·
added 10 exports
get.rlecuyerSeedOption, set.rlecuyerSeedOption, sacsarlm, do_ldet, eigen_setup, mcdet_setup, cheb_setup, spam_setup, Matrix_setup, LU_setup - 0.5-42010-04-04 · diff ↗
- 0.5-32010-03-22 · diff ↗ ·
added 6 exports
set.VerboseOption, get.VerboseOption, set.ZeroPolicyOption, get.ZeroPolicyOption, set.ClusterOption, get.ClusterOption - 0.4-592010-02-25 · diff ↗
- 0.4-58
- 0.4-562009-12-18 · diff ↗
- 0.4-542009-11-26 · diff ↗
- 0.4-522009-11-05 · diff ↗
- 0.4-502009-10-19 · diff ↗
- 0.4-492009-10-13 · diff ↗
- 0.4-472009-10-12 · diff ↗
- 0.4-462009-10-07 · diff ↗ ·
added 9 exports
Hausman.sarlm, powerWeights, trW, impacts.sarlm, print.sarlmImpact, summary.sarlmImpact, print.summary.sarlmImpact, plot.sarlmImpact, HPDinterval.sarlmImpact - 0.4-362009-08-19 · diff ↗
- 0.4-342009-01-21 · diff ↗
- 0.4-292008-10-26 · diff ↗
- 0.4-242008-07-05 · diff ↗
- 0.4-212008-05-16 · diff ↗
- 0.4-202008-03-25 · diff ↗ ·
removed 2 exports
as_dgCMatrix_I, as_dgCMatrix_IrWadded 2 exports
as_dsCMatrix_I, as_dsCMatrix_IrW - 0.4-172008-02-18 · diff ↗
- 0.4-132008-01-01 · diff ↗
- 0.4-122007-12-30 · diff ↗ ·
removed 4 exports
asMatrixCsrListw, asMatrixCsrI, asMatrixCsrIrW, asListwMatrixCsradded 7 exports
lm.morantest.exact, print.moranex, localmoran.exact, localmoran.exact.alt, print.localmoranex, as.data.frame.localmoranex, as.spam.listw - 0.4-92007-11-03 · diff ↗
- 0.4-82007-10-30 · diff ↗
- 0.4-72007-10-09 · diff ↗
- 0.4-62007-09-21 · diff ↗
- 0.4-42007-06-11 · diff ↗
- 0.4-22007-03-28 · diff ↗
- 0.4-12007-03-23 · diff ↗ ·
added 8 exports
nblag_cumul, nb2WB, listw2WB, as_dgRMatrix_listw, as_dsTMatrix_listw, as_dgCMatrix_I, as_dgCMatrix_IrW, Jacobian_W - 0.3-322006-11-14 · diff ↗
- 0.3-312006-09-06 · diff ↗
- 0.3-302006-08-19 · diff ↗
- 0.3-292006-08-03 · diff ↗
- 0.3-282006-07-27 · diff ↗
- 0.3-252006-05-22 · diff ↗
- 0.3-242006-05-19 · diff ↗
- 0.3-222006-03-10 · diff ↗ ·
added 10 exports
ME, print.ME_res, fitted.ME_res, stsls, print.stsls, summary.stsls, print.summary.stsls, residuals.stsls, coef.stsls, deviance.stsls - 0.3-212006-02-28 · diff ↗
- 0.3-172005-12-16 · diff ↗
- 0.3-162005-11-30 · diff ↗
- 0.3-132005-10-14 · diff ↗
- 0.3-122005-04-19 · diff ↗
- 0.3-102005-03-08 · diff ↗ ·
removed 2 exports
spwdet, logSpwdetadded 4 exports
nb2lines, listw2lines, df2sn, plot.listw - 0.3-82004-12-29 · diff ↗
- 0.3-72004-12-15 · diff ↗
- 0.3-52004-12-09 · diff ↗ ·
added 6 exports
asMatrixCsrListw, asMatrixCsrI, asMatrixCsrIrW, asListwMatrixCsr, is.symmetric.glist, similar.listw - 0.2-222004-10-04 · diff ↗
- 0.2-182004-05-26 · diff ↗
- 0.2-17
- 0.2-14
- RR 1.9.0 released · 2004-04-12
- 0.2-12
- 0.2-112004-01-24 · diff ↗
- 0.2-10
- 0.2-9
- 0.2-82003-12-19 · diff ↗ ·
removed 1 export
log.spwdetadded 35 exports
LR1.sarlm, Wald1.sarlm, logSpwdet, print.nb, summary.nb, plot.nb, edit.nb, subset.nb, summary.listw, print.listw, plot.Gabriel, plot.relative, print.jclist, print.LMtestlist, plot.mc.sim, as.data.frame.localmoransad, print.localmoransad, summary.localmoransad, print.summary.localmoransad, print.moransad, summary.moransad, print.summary.moransad, print.spcor, plot.spcor, print.sarlm, summary.sarlm, residuals.sarlm, deviance.sarlm, coef.sarlm, fitted.values.sarlm and 5 more - 0.2-62003-11-12 · diff ↗
- RR 1.8.0 released · 2003-10-08
- 0.2-52003-09-26 · diff ↗
- 0.2-4
- 0.2-32003-09-05 · diff ↗ ·
added 79 exports
EBImoran.mc, probmap, EBest, EBlocal, LR.sarlm, airdist, card, rookcell, queencell, mrc2vi, vi2mrc, cell2nb, n.comp.nb, diffnb, dnearneigh, droplinks, eigenw, errorsarlm, gabrielneigh, geary.test, geary, geary.mc, globalG.test, graph2nb, joincount.test, joincount.mc, knearneigh, knn2nb, lagsarlm, listw2sn and 49 more - 0.1-132003-08-07 · diff ↗
- 0.1-102003-04-29 · diff ↗
- 0.1-92003-04-27 · diff ↗
- RR 1.7.0 released · 2003-04-16
- 0.1-82003-01-24 · diff ↗
- RR 1.6.0 released · 2002-10-01
- 0.1-62002-08-20 · diff ↗
- 0.1-42002-05-01 · diff ↗
- RR 1.5.0 released · 2002-04-29
- 0.1-32002-04-19 · diff ↗
- 0.1-22002-03-20
Package metadata
- First published
- 2002-03-20
- Total releases
- 189 / 24 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 3.3.0
- Bundled data
- 25 KB / 3 files
- Download size
- 4.5 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("spdep")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1007/s11749-018-0599-x, 10.1111/gean.12319.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.