require(sp)
data(meuse.grid)
meuse.grid <- meuse.grid[, 1:2]
pts1 <- sample(c(1:dim(meuse.grid)[1]), 155)
pts2 <- meuse.grid[pts1, ]
pts3 <- spJitterFinite(points = pts2, candidates = meuse.grid, which.pts = 10,
x.min = 40, x.max = 100, y.min = 40, y.max = 100)
plot(meuse.grid, asp = 1, pch = 15, col = "gray")
points(pts2, col = "red", cex = 0.5)
points(pts3, pch = 19, col = "blue", cex = 0.5)Run the code above in your browser using DataLab