require(GeoModels)
NN <- 400
coords <- cbind(runif(NN), runif(NN))
corrmodel <- "Matern"
scale <- 0.5/3
param <- list(mean=0, sill=1, nugget=0, scale=scale, smooth=0.5)
set.seed(951)
data <- GeoSim(coordx=coords, corrmodel=corrmodel,
model="Gaussian", param=param)$data
sel <- GeoNeighIndex(coordx=coords, neighb=5)
data1 <- data[sel$colidx]
data2 <- data[sel$rowidx]
## plotting pairs that are neighbours of order 5
plot(data1, data2, xlab="", ylab="",
main="h-scatterplot, neighb=5")
Run the code above in your browser using DataLab