subset point data set by distance ranges
On Tue, 9 Dec 2008, David M Warner wrote:
Greetings I'm using R 2.8 with recent (last month) versions of the packages I need to use at present. ? I'm interested in examining hierarchical spatio-temporal patterns in a data set.??The data consist of 94 points (X, Y, UTM coordinates) at which catch rates for a fish were recorded and there are also estimates of prey available for these fish at the same locations.? I have reason to believe that the relationships between predators and prey varies with spatial scale (nested processes). ? To test this hypothesis, I'd like?to generate subsets of the points that are separated by distance ranges (1-50 km, 51-100 km, etc) so I can run Sncf (package ncf) on the subsets. ? I cannot find a way to do this with R code.? Getting a distance matrix is easy.??Using that to help generate?a series of distance-based subsets is something I cannot figure out (without manually entering a list of all the point pairs).
Perhaps see dnearneigh() in spdep? It will return a list of vectors of point indices within the distance thresholds given, which you could post-process for your purposes. Roger
? Any suggestions would be appreciated. Dave Warner? David?Warner Research?Fishery?Biologist USGS?Great?Lakes?Science?Center 1451?Green?Road Ann?Arbor?MI?48105 734.214.9392
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no