[R-sig-Geo] sub-selecting spatial data by distance from a different point(set)

Sean O'Riordain seanpor at acm.org
Fri Nov 13 16:54:45 CET 2009


Good afternoon,

Apologies if this seems a basic question but I'm quite new to spatial
analysis (1 week now!) and I'm reading and learning as fast as I can.
I've read the Spatial Data task view, "Analysing spatial point
patterns in R" by Bradley and I've ordered "Applied Spatial Data
Analysis with R" - but it hasn't arrived yet...  I've looked and
searched - but I'm guessing that I'm not using the right buzzwords...

I have a data.frame (call it A) of about 2 million X,Y points each
with info with various characteristics, numeric and factor.  I have a
separate much smaller data.frame (call it B) of say 500 rows of X,Y
and I'd like to be able to pull a subset of A, so that for each B[i,]
I will get all rows from A that are within a given straight line
distance (i.e. within a short 'as the crow flies' radius).

Could somebody please give me some starting hints please?

Thanks in advance,
Sean O'Riordain



More information about the R-sig-Geo mailing list