Re: [R] Spatial join - optimizing code

2008-09-16 Thread Monica Pisica
ver 440 times faster . Thank you so much! Monica > Date: Tue, 16 Sep 2008 14:10:34 -0400 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > CC: r-help@r-project.org > Subject: Re: [R] Spatial join ? optimizing code > > Hi Monica, > > I think the key to spee

Re: [R] Spatial join ? optimizing code

2008-09-16 Thread Dan Davison
Hi Monica, I think the key to speeding this up is, for every point in 'track', to compute the distance to all points in 'classif' 'simultaneously', using vectorized calculations. Here's my function. On my laptop it's about 160 times faster than the original for the case I looked at (10,000 observa

[R] Spatial join – optimizing code

2008-09-16 Thread Monica Pisica
Hi, Few days ago I have asked about spatial join on the minimum distance between 2 sets of points with coordinates and attributes in 2 different data frames. Simon Knapp sent code to do it when calculating distance on a sphere using lat, long coordinates and I've change his code to use Euclidi