Package: spdep 1.3-9

Roger Bivand

spdep: Spatial Dependence: Weighting Schemes, Statistics

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>. 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. 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'.

Authors:Roger Bivand [cre, aut], Micah Altman [ctb], Luc Anselin [ctb], Renato Assunção [ctb], Anil Bera [ctb], Olaf Berke [ctb], F. Guillaume Blanchet [ctb], Marilia Carvalho [ctb], Bjarke Christensen [ctb], Yongwan Chun [ctb], Carsten Dormann [ctb], Stéphane Dray [ctb], Dewey Dunnington [ctb], Virgilio Gómez-Rubio [ctb], Malabika Koley [ctb], Tomasz Kossowski [ctb], Elias Krainski [ctb], Pierre Legendre [ctb], Nicholas Lewin-Koh [ctb], Angela Li [ctb], Giovanni Millo [ctb], Werner Mueller [ctb], Hisaji Ono [ctb], Josiah Parry [ctb], Pedro Peres-Neto [ctb], Michał Pietrzak [ctb], Gianfranco Piras [ctb], Markus Reder [ctb], Jeff Sauer [ctb], Michael Tiefelsdorf [ctb], René Westerholt [ctb], Justyna Wilk [ctb], Levi Wolf [ctb], Danlin Yu [ctb]

spdep_1.3-9.tar.gz
spdep_1.3-9.zip(r-4.5)spdep_1.3-9.zip(r-4.4)spdep_1.3-9.zip(r-4.3)
spdep_1.3-9.tgz(r-4.4-x86_64)spdep_1.3-9.tgz(r-4.4-arm64)spdep_1.3-9.tgz(r-4.3-x86_64)spdep_1.3-9.tgz(r-4.3-arm64)
spdep_1.3-9.tar.gz(r-4.5-noble)spdep_1.3-9.tar.gz(r-4.4-noble)
spdep_1.3-9.tgz(r-4.4-emscripten)spdep_1.3-9.tgz(r-4.3-emscripten)
spdep.pdf |spdep.html
spdep/json (API)
NEWS

# Install 'spdep' in R:
install.packages('spdep', repos = c('https://r-spatial.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/r-spatial/spdep/issues

Pkgdown:https://r-spatial.github.io

Datasets:
  • COL.OLD - Columbus OH spatial analysis data set - old numbering
  • COL.nb - Columbus OH spatial analysis data set - old numbering
  • bbs - Columbus OH spatial analysis data set
  • col.gal.nb - Columbus OH spatial analysis data set
  • columbus - Columbus OH spatial analysis data set
  • coords - Columbus OH spatial analysis data set
  • eire.coords.utm - Eire data sets
  • eire.df - Eire data sets
  • eire.nb - Eire data sets
  • eire.polys.utm - Eire data sets
  • polys - Columbus OH spatial analysis data set

On CRAN:

spatial-autocorrelationspatial-dependencespatial-weights

16.59 score 126 stars 103 packages 6.1k scripts 43k downloads 233 mentions 167 exports 18 dependencies

Last updated 7 hours agofrom:9d6228a92b. Checks:OK: 5 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKDec 19 2024
R-4.5-win-x86_64OKDec 19 2024
R-4.5-linux-x86_64OKDec 19 2024
R-4.4-win-x86_64OKDec 19 2024
R-4.4-mac-x86_64NOTEDec 19 2024
R-4.4-mac-aarch64NOTEDec 19 2024
R-4.3-win-x86_64OKDec 19 2024
R-4.3-mac-x86_64NOTEDec 19 2024
R-4.3-mac-aarch64NOTEDec 19 2024

Exports:addlinks1aggregate.nbairdistas.data.frame.localmoranexas.data.frame.localmoransadautocov_distcardcell2nbchkIDschoynowskicoercecomplement.nbdf2sndiffnbdnearneighdroplinksEBestEBImoran.mcEBlocaledit.nbgabrielneighgearygeary.mcgeary.testget.ClusterOptionget.coresOptionget.mcOptionget.NoNeighbourOptionget.spChkOptionget.SubgraphCeilingget.SubgraphOptionget.VerboseOptionget.ZeroPolicyOptionglobalG.testgraph2nbgrid2nbhotspotinclude.selfintersect.nbis.symmetric.glistis.symmetric.nbjoincount.mcjoincount.multijoincount.testknearneighknn2nblag.listwleelee.mclee.testlicd_multilistw2lineslistw2matlistw2snlistw2starlistw2Ulistw2WBlm.LMtestslm.morantestlm.morantest.exactlm.morantest.sadlm.RStestslocal_joincount_bvlocal_joincount_unilocalClocalC_permlocalGlocalG_permlocalGSlocalmoranlocalmoran_bvlocalmoran_permlocalmoran.exactlocalmoran.exact.altlocalmoran.sadLOSHLOSH.csLOSH.mcmake.sym.nbmat2listwmoranmoran_bvmoran.mcmoran.plotmoran.testmstreen.comp.nbnb2blocknbnb2INLAnb2linesnb2listwnb2listwdistnb2matnb2WBnbcostnbcostsnbdistsnblagnblag_cumulold.make.sym.nbp.adjustSPplot.Gabrielplot.listwplot.mc.simplot.mstplot.nbplot.relativeplot.skaterplot.spcorpoly2nbprint.jclistprint.jcmultiprint.localmoranexprint.localmoransadprint.moranexprint.moransadprint.spcorprint.summary.localmoransadprint.summary.moransadprobmapprunecostprunemstread_swm_dbfread.dat2listwread.galread.geodaread.gwt2nbread.swmdbf2listwrelativeneighremove.selfRotationSD.RStestsset.ClusterOptionset.coresOptionset.mcOptionset.NoNeighbourOptionset.spChkOptionset.SubgraphCeilingset.SubgraphOptionset.VerboseOptionset.ZeroPolicyOptionsetdiff.nbskatersn2listwsoi.graphsp.correlogramsp.mantel.mcspdepspNamedVecspweights.constantssswsubset.listwsubset.nbsummary.localmoransadsummary.moransadsym.attr.nbSzerotolerance.nbtri2nbunion.nbvi2mrcwrite_swm_dbfwrite.nb.galwrite.sn2datwrite.sn2DBFwrite.sn2gwtwrite.swmdbf

Dependencies:bootclassclassIntDBIdeldire1071KernSmoothlatticemagrittrMASSproxyRcpps2sfspspDataunitswk

“The Problem of Spatial Autocorrelation:” forty years on

Rendered fromCO69.Rmdusingknitr::rmarkdownon Dec 19 2024.

Last update: 2024-09-07
Started: 2019-01-09

Creating Neighbours

Rendered fromnb.Rmdusingknitr::rmarkdownon Dec 19 2024.

Last update: 2024-09-07
Started: 2020-11-23

Creating Neighbours using sf objects

Rendered fromnb_sf.Rmdusingknitr::rmarkdownon Dec 19 2024.

Last update: 2024-11-25
Started: 2017-11-01

Introduction to the North Carolina SIDS data set (re-revised)

Rendered fromsids.Rmdusingknitr::rmarkdownon Dec 19 2024.

Last update: 2024-12-02
Started: 2019-01-09

No-neighbour observation and subgraph handling

Rendered fromsubgraphs.Rmdusingknitr::rmarkdownon Dec 19 2024.

Last update: 2024-10-02
Started: 2024-09-06

Readme and manuals

Help Manual

Help pageTopics
Aggregate a spatial neighbours objectaggregate.nb
Measure distance from plotairdist
Distance-weighted autocovariateautocov_dist
Data set with 4 life condition indices of Belo Horizonte regionbhicv
Cardinalities for neighbours listscard
Generate neighbours list for grid cellscell2nb vi2mrc
Choynowski probability map valueschoynowski
Columbus OH spatial analysis data setbbs col.gal.nb columbus coords polys
Differences between neighbours listsdiffnb
Neighbourhood contiguity by distancednearneigh
Drop and add links in a neighbours listaddlinks1 droplinks
Global Empirical Bayes estimatorEBest
Permutation test for empirical Bayes indexEBImoran EBImoran.mc
Local Empirical Bayes estimatorEBlocal
Interactive editing of neighbours listsedit.nb
Eire data setseire eire.coords.utm eire.df eire.nb eire.polys.utm
Compute Geary's Cgeary
Permutation test for Geary's C statisticgeary.mc
Geary's C test for spatial autocorrelationgeary.test
Global G test for spatial autocorrelationglobalG.test
Depth First Search on Neighbor Listsn.comp.nb
Graph based spatial weightsgabrielneigh graph2nb plot.Gabriel plot.relative relativeneigh soi.graph
Construct neighbours for a GridTopologygrid2nb
Cluster Classifications for Local Indicators of Spatial Association and Local Indicators for Categorical Datahotspot hotspot.data.frame.localmoranex hotspot.default hotspot.licd hotspot.localC hotspot.localG hotspot.localmoran hotspot.summary.localmoransad
Include self in neighbours listinclude.self remove.self
Test a neighbours list for symmetryis.symmetric.glist is.symmetric.nb make.sym.nb old.make.sym.nb sym.attr.nb
Permutation test for same colour join count statisticsjoincount.mc
BB, BW and Jtot join count statistic for k-coloured factorsjoincount.multi print.jcmulti
BB join count statistic for k-coloured factorsjoincount.test print.jclist
K nearest neighbours for spatial weightsknearneigh
Neighbours list from knn objectknn2nb
Spatial lag of a numeric vectorlag.listw
Compute Lee's statisticlee
Permutation test for Lee's L statisticlee.mc
Lee's L test for spatial autocorrelationlee.test
Local Indicators for Categorical Datalicd_multi
Spatial neighbour sparse representationlistw2sn sn2listw
Rao's score (a.k.a Lagrange Multiplier) diagnostics for spatial dependence in linear modelslm.LMtests lm.RStests print.RStestlist print.RStestlist.summary summary.RStestlist
Moran's I test for residual spatial autocorrelationlm.morantest
Exact global Moran's I testlm.morantest.exact print.moranex
Saddlepoint approximation of global Moran's I testlm.morantest.sad print.moransad print.summary.moransad summary.moransad
Calculate the local bivariate join countlocal_joincount_bv
Calculate the local univariate join countlocal_joincount_uni
Compute Local Geary statisticlocalC localC.data.frame localC.default localC.formula localC.list localC.matrix localC_perm localC_perm.default localC_perm.formula
G and Gstar local spatial statisticslocalG localG_perm
A local hotspot statistic for analysing multiscale datasetslocalGS
Local Moran's I statisticlocalmoran localmoran_perm
Compute the Local Bivariate Moran's I Statisticlocalmoran_bv
Exact local Moran's Ii testsas.data.frame.localmoranex localmoran.exact localmoran.exact.alt print.localmoranex
Saddlepoint approximation of local Moran's Ii testsas.data.frame.localmoransad listw2star localmoran.sad print.localmoransad print.summary.localmoransad summary.localmoransad
Local spatial heteroscedasticityLOSH
Chi-square based test for local spatial heteroscedasticityLOSH.cs
Bootstrapping-based test for local spatial heteroscedasticityLOSH.mc
Convert a square spatial weights matrix to a weights list objectmat2listw
Compute Moran's Imoran
Compute the Global Bivariate Moran's Imoran_bv
Permutation test for Moran's I statisticmoran.mc
Moran scatterplotmoran.plot
Moran's I test for spatial autocorrelationmoran.test
Find the minimal spanning treemstree
Set operations on neighborhood objectscomplement.nb intersect.nb setdiff.nb union.nb
Block up neighbour list for location-less observationsnb2blocknb
Output spatial neighbours for INLAnb2INLA
Use vector files for import and export of weightsdf2sn listw2lines nb2lines
Spatial weights for neighbours listslistw2U nb2listw
Distance-based spatial weights for neighbours listsnb2listwdist
Spatial weights matrices for neighbours listslistw2mat nb2mat
Output spatial weights for WinBUGSlistw2WB nb2WB
Compute cost of edgesnbcost nbcosts
Spatial link distance measuresnbdists
Higher order neighbours listsnblag nblag_cumul
Columbus OH spatial analysis data set - old numberingCOL.nb COL.OLD oldcol
Adjust local association measures' p-valuesp.adjustSP
Plot the Minimum Spanning Treeplot.mst
Plot a neighbours listplot.listw plot.nb
Plot the object of skater classplot.skater
Construct neighbours list from polygon listpoly2nb
Probability mapping for ratesprobmap
Compute cost of prune each edgeprunecost
Prune a Minimun Spanning Treeprunemst
Read a GAL lattice file into a neighbours listread.gal read.geoda
Read and write spatial neighbour filesread.dat2listw read.gwt2nb read.swmdbf2listw read_swm_dbf write.sn2dat write.sn2DBF write.sn2gwt write.swmdbf write_swm_dbf
Rotate a set of point by a certain angleRotation
Rao's score and adjusted Rao's score tests of linear hypotheses for spatial Durbin and spatial Durbin error modelsSD.RStests
Options for parallel supportget.ClusterOption get.coresOption get.mcOption set.ClusterOption set.coresOption set.mcOption
Control checking of spatial object IDschkIDs get.listw_is_CsparseMatrix_Option get.NoNeighbourOption get.spChkOption get.SubgraphCeiling get.SubgraphOption get.VerboseOption get.ZeroPolicyOption set.listw_is_CsparseMatrix_Option set.NoNeighbourOption set.spChkOption set.SubgraphCeiling set.SubgraphOption set.VerboseOption set.ZeroPolicyOption spNamedVec
Spatial 'K'luster Analysis by Tree Edge Removalskater
Spatial correlogramplot.spcor print.spcor sp.correlogram
Mantel-Hubert spatial general cross product statisticplot.mc.sim sp.mantel.mc
Return package version numberspdep
Defunct Functions in Package 'spdep'anova.sarlm aple aple.mc aple.plot as.data.frame.sarlm.pred as.spam.listw as_dgRMatrix_listw as_dsCMatrix_I as_dsCMatrix_IrW as_dsTMatrix_listw bptest.sarlm can.be.simmed cheb_setup coef.gmsar coef.lagmess coef.sarlm coef.spautolm coef.stsls coerce,listw,CsparseMatrix-method coerce,listw,RsparseMatrix-method coerce,listw,symmetricMatrix-method create_WX deviance.gmsar deviance.lagmess deviance.sarlm deviance.spautolm deviance.stsls do_ldet eigenw eigen_pre_setup eigen_setup errorsarlm fitted.gmsar fitted.lagmess fitted.ME_res fitted.sarlm fitted.SFResult fitted.spautolm GMargminImage GMerrorsar griffith_sone gstsls Hausman.test Hausman.test.gmsar Hausman.test.sarlm HPDinterval.lagImpact impacts impacts.gmsar impacts.lagmess impacts.MCMC_sac_g impacts.MCMC_sar_g impacts.MCMC_sem_g impacts.sarlm impacts.SLX impacts.stsls intImpacts jacobianSetup Jacobian_W lagmess lagsarlm lextrB lextrS lextrW lmSLX localAple logLik.lagmess logLik.sarlm logLik.spautolm LR.sarlm LR1.sarlm LR1.spautolm LU_prepermutate_setup LU_setup l_max Matrix_J_setup Matrix_setup mcdet_setup MCMCsamp MCMCsamp.sarlm MCMCsamp.spautolm ME moments_setup mom_calc mom_calc_int2 plot.lagImpact powerWeights predict.sarlm predict.SLX print.gmsar print.lagImpact print.lagmess print.ME_res print.sarlm print.sarlm.pred print.SFResult print.spautolm print.stsls print.summary.gmsar print.summary.lagImpact print.summary.lagmess print.summary.sarlm print.summary.spautolm print.summary.stsls residuals.gmsar residuals.lagmess residuals.sarlm residuals.spautolm residuals.stsls sacsarlm SE_classic_setup SE_interp_setup SE_whichMin_setup similar.listw spam_setup spam_update_setup SpatialFiltering spautolm spBreg_err spBreg_lag spBreg_sac spdep-defunct stsls subgraph_eigenw summary.gmsar summary.lagImpact summary.lagmess summary.sarlm summary.spautolm summary.stsls trW vcov.sarlm Wald1.sarlm
Provides constants for spatial weights matricesspweights.constants Szero
Compute the sum of dissimilarityssw
Subset a spatial weights listsubset.listw
Subset a neighbours listsubset.nb
Print and summary function for neighbours and weights listsprint.listw print.nb print.summary.listw print.summary.nb summary.listw summary.nb
Function to construct edges based on a tolerance angle and a maximum distancetolerance.nb
Neighbours list from tri objecttri2nb
Write a neighbours list as a GAL lattice filewrite.nb.gal