[R] SPDEP Package, neighbours list for Moran's I on large grid dataset

Roger Bivand Roger.Bivand at nhh.no
Wed Apr 20 13:41:06 CEST 2011

There is a recent thread on the R-sig-geo list that addresses your need,
using a focal function in the raster package. The thread is at:


That list may be a better place to post on this topic.

Hope this helps,


Laurent Jégou wrote:
> Hello list members, i'd like to calculate the Moran I on a large dataset,
> a
> 8640x3432 grid of values.
> When i try to create the neighbours list with the cell2nb function, on
> such
> a scale, R works for several hours and seems to crash. I'm using the last
> version (2.13), 64 bits, on a mac pro with 4go of memory.
> I think that i'm doing it wrong :-)
> I'd like to use a "moving window" weight matrix instead of a full scale
> one,
> but i was not lucky enough to find a solution in the docs.
> Thanks for any help,
> Laurent
> -- 
> Laurent Jégou
> Cartographe et enseignant
> UTM - Dépt. Géographie
> 31058 TOULOUSE Cedex 9 -
> http://www.univ-tlse2.fr/geoprdc
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Roger Bivand
Economic Geography Section
Department of Economics
Norwegian School of Economics and Business Administration
Helleveien 30
N-5045 Bergen, Norway

View this message in context: http://r.789695.n4.nabble.com/SPDEP-Package-neighbours-list-for-Moran-s-I-on-large-grid-dataset-tp3460184p3462767.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list