[R] mat2listw function

Jacquelyn Pless
Fri, 29 Nov 2013 20:05:34 -0000

Hi all,

I am attempting to create a weights object and perform a Moran I test as
well. I have a very large spatial weights matrix (roughly 22,000x22,000)
that was created in Excel and read into R, and I'm now trying to implement:

library(spdep)
SW=mat2listw(matrix)

I am getting the following error:
Error in if (any(x<0)) stop ("values in x cannot be negative"):
missing
value where TRUE/FALSE needed.

What's going wrong here? My current matrix is all 0's and 1's, with
no
missing values and no negative elements. What am I missing?

I'd appreciate any advice. Thanks in advance for your help!

Best,
Jacquelyn

	[[alternative HTML version deleted]]