[R-sig-Geo] create data frame after spDists

2012-08-24 Thread swagath navin
Hello all, I have two spatial points data frame df1 showing sample locations and df2 meteorological stations. I am interested in finding met stations closer to the sample stations and creating a separate data frame with sample locations and the nearest met station. I calculated the distances betw

[R-sig-Geo] create data frame after spDists (re-posted)

2012-08-24 Thread swagath navin
Hello all, sorry for re-posting, but i got a scrub message for my first mail. I have two spatial points data frame df1 showing sample locations and df2 meteorological stations. I am interested in finding met stations closer to the sample stations and creating a separate data frame with sample loca

Re: [R-sig-Geo] create data frame after spDists (re-posted)

2012-08-24 Thread Rolf Turner
I believe that you would find the tools in the "spatstat" package (e.g. crossdist()) useful. cheers, Rolf Turner On 25/08/12 00:24, swagath navin wrote: Hello all, sorry for re-posting, but i got a scrub message for my first mail. I have two spatial points data frame df1 showing

Re: [R-sig-Geo] create data frame after spDists (re-posted)

2012-08-24 Thread Robert J. Hijmans
Navin, I think you can achieve that like this: mnd <- apply(dist, 1, which.min) cbind(coordinates(df1), coordinates(df2)[mnd, ]) Robert On Fri, Aug 24, 2012 at 5:24 AM, swagath navin wrote: > Hello all, sorry for re-posting, but i got a scrub message for my first > mail. > > I have two spatial

Re: [R-sig-Geo] create data frame after spDists (re-posted)

2012-08-25 Thread O'Hanlon, Simon J
auckland.ac.nz] Sent: 24 August 2012 21:42 To: swagath navin Cc: r-sig-geo@r-project.org Subject: Re: [R-sig-Geo] create data frame after spDists (re-posted) I believe that you would find the tools in the "spatstat" package (e.g. crossdist()) useful. cheers, Rolf Turner

Re: [R-sig-Geo] create data frame after spDists (re-posted)

2012-08-27 Thread Swagath Navin
r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] on behalf of Rolf Turner [r.tur...@auckland.ac.nz] Sent: 24 August 2012 21:42 To: swagath navin Cc: r-sig-geo@r-project.org Subject: Re: [R-sig-Geo] create data frame after spDists (re-posted) I believe that you would find the to