https://github.com/cran/spatstat
Raw File
Tip revision: 2af0235a57146624ae8d5b148d47d8d0ab351213 authored by Adrian Baddeley on 14 May 2007, 05:36:09 UTC
version 1.11-5
Tip revision: 2af0235
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