https://github.com/cran/spatstat
Raw File
Tip revision: c75a36fce807d4a1105403c1f8628a196a3e54da authored by Adrian Baddeley on 24 October 2008, 14:28:47 UTC
version 1.14-5
Tip revision: c75a36f
correctC.R
# tests for agreement between C and interpreted code
require(spatstat)

# pairdist.ppp
X <- rpoispp(42)
dC <- pairdist(X, method="C")
dR <- pairdist(X, method="interpreted")
range(dC - dR)

dC <- pairdist(X, periodic=TRUE, method="C")
dR <- pairdist(X, periodic=TRUE, method="interpreted")
range(dC - dR)

# crossdist.ppp
Y <- rpoispp(42)
dC <- crossdist(X, Y, method="C")
dR <- crossdist(X, Y, method="interpreted")
range(dC - dR)

dC <- crossdist(X, Y, periodic=TRUE, method="C")
dR <- crossdist(X, Y, periodic=TRUE, method="interpreted")
range(dC - dR)



back to top