https://github.com/cran/spatstat
Raw File
Tip revision: 59bf17bc31bd0f63ad47579b40d1c3d10e9d8a10 authored by Adrian Baddeley on 20 November 2006, 21:03:00 UTC
version 1.10-3
Tip revision: 59bf17b
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