I'm trying to measure the distance that nestlings moved from their original nest sites to territories they established the next year. I'd like to do this using the spatstat package, but I'm having trouble with the output with some of its functions (e.g., nncross, nndist, crossdist). Here's what my code looks like, and the data is here: https://sites.google.com/site/datastackoverflow/shapefiles
library(raster)
library(spatstat)
library(maptools)
# read in shapefile with nest locations (UTMs) and convert to ppp format:
nests <- readShapeSpatial("nest_locs.shp")
X<-as.ppp(nests)
X
# read in shapefile with juvenile locations (UTMs) and convert to ppp format:
juvs <- readShapeSpatial("juv_locs.shp")
Y<-as.ppp(juvs)
Y
# calculate the distance between nest points and juveniles:
N<-nncross(X,Y)
N
# another option
crossdist(X, Y)
The results look something like this:
> crossdist(X, Y)
[,1] [,2]
[1,] 2756.546 1994.002
[2,] 3831.429 3466.360
Is it possible to retain the point ID's, in this case the nestID and corresponding birdID's instead of row and column numbers?