[R] Subsetting NaN values in localG()
dab98
dab98 at cornell.edu
Wed Jul 13 16:17:21 CEST 2011
Still have not solved this problem with package 'spdep'. It appears localG()
cannot handle either SpatialPoints or a matrix of point coordinates that are
not in a rectangular matrix when plotted. It cannot take NaN values and,
after I successfully used dnearnigh() to create an "nb" object for ONLY
Northeast land points and converted to a 'listw' object, it still returned
the same error. See below ("points" is a 2-column matrix of lat-long point
coordinates; diffD is my data matrix):
/ > neigh2 = dnearneigh(points,0,5,longlat=TRUE)
> mylist = nb2listw(neigh2,style="B")
> stats = localG(diffD,mylist)
Error in matrix(0, nrow = nrow(x), ncol = ncol(x)) :
invalid 'ncol' value (too large or NA)/
Again, if anyone thinks this analysis is incorrect, please let me know. If
not, I'll just abandon R for this portion of the project, as it is taking
far too long to use this this package with Getis-Ord statistics, which
should run fairly easily.
--
View this message in context: http://r.789695.n4.nabble.com/Subsetting-NaN-values-in-localG-tp3662781p3665146.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list