I'm trying to calculate pair distances among the points of my dataset. I have point in EPSG:3857.
This is the code I ran:
I import the data, then:
coordinates(datPb) <- c("X","Y")
proj4string(datPb) <- CRS("+init=epsg:3857")
datPb_owin <- as.owin(list(xrange=c(min(datPb$X),max(datPb$X)),yrange=c(min(datPb$Y),max(datPb$Y))))
datPb.ppp <- ppp(x=datPb$X, y=datPb$Y,marks=datPb$Pb, window=datPb_owin)
pairdist(datPb.ppp)
The pairdist function return a matrices of distance but I know (from field measurements and comparison with QGIS on a subsample of points) that these distances are not correct. I though it might be an error in the understanding of the EPSG but when I save back my data as a shapefile and measure distance in QGIS again they are fine.
here is a subset of my data:
quadrat X Y
28 271322.8329 6231012.4650
29 271313.2814 6231006.6400
30 271319.1768 6231013.2850
31 271326.7498 6231017.9710