Closed baddstats closed 3 years ago
nncross.ppp produces wrong answers in the following example:
nncross.ppp
A <- data.frame( m= c("K", "K", "A1", "A2", "G", "A2", "A3"), x=c(4.85, 6.76, 10.58, 19.18, 15.74, 19.08, 12.27), y=c(5.60, 12.92, 11.14, 17.22, 5.74, 1.24, 2.20), stringsAsFactors=TRUE ) X <- with(A, ppp(x, y, marks=m, window=bounding.box.xy(x, y))) wrong <- nncross(X, X[7], iX=1:7, iY=7L)$dist right <- pairdist(X)[,7] right[7] <- Inf right wrong
Bug is fixed in development version spatstat.geom 2.0-1.005
spatstat.geom 2.0-1.005
nncross.ppp
produces wrong answers in the following example: