Sasha,

thanks a lot for the quick answer, it is exactly what I needed and works
fine.

My bad, I must have failed to see it when checking the spatstat manual

G


On Wed, Apr 16, 2014 at 4:39 PM, Sasha Cuerda <sasha.cuerda@gmail.com>wrote:

> Gabriele,
>
> Check out the nncross function within spatstat. Should be what you are
> looking for.
>
> Sasha
>
> On Wed, Apr 16, 2014 at 10:20 AM, Gabriele Cozzi <gab.cozzi@gmail.com>
> wrote:
> > Dear list,
> >
> > I have two data sets sets:
> > - one with lon lat coordinates of relocation events from GPS radio
> collared
> > animals and
> > - one with lon lat coordinates of villages.
> >
> > For each animal relocation (n = 50'000 ), I want to compute the distance
> to
> > the nearest village (n = 40). I am failing to find a function that allows
> > this calculation between two data sets and only find functions that
> return
> > the neared neighbour from within a single data set such as
> >  nndist{spatstat}.
> >
> > Is there a function that returns the distance between each location in a
> > data frame and the closes location from another data frame?
> >
> > Alternatively I was considering, in turn (through a loop) pasting each
> > animal relocation into the villages data set, calculate the nearest
> > neighbour and then paste the distance to the nearest village back to the
> > original animal relocation data set, but this seems an incredibly
> > non-efficient solution...
> >
> > Any suggestion will be highly appreciated!
> >
> > Thanks,
> > Gabriele
> >
> >
> > --
> > Gabriele Cozzi
> > Postdoctoral Research Associate
> > Population Ecology Research Group
> > http://www.popecol.org
> >
> > Zurich University
> > Institute of Evolutionary Biology and Environmental Studies
> > Winterthurerstr. 190
> > 8057 Zurich - Switzerland
> > E-mail: gabriele.cozzi@uzh.ch
> > Phone: +41(0)44 635 49 12
> > Fax: +41(0)16355711
> > http://www.ieu.uzh.ch
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Gabriele Cozzi
Postdoctoral Research Associate
Population Ecology Research Group
http://www.popecol.org

Zurich University
Institute of Evolutionary Biology and Environmental Studies
Winterthurerstr. 190
8057 Zurich - Switzerland
E-mail: gabriele.cozzi@uzh.ch
Phone: +41(0)44 635 49 12
Fax: +41(0)16355711
http://www.ieu.uzh.ch

	[[alternative HTML version deleted]]

