if (FALSE) {
# Example 1
set.seed(12345);
N = 1000; # population size
n = 100; # sample size
p = rep(n/N,N); # inclusion probabilities
X = cbind(runif(N),runif(N)); # matrix of auxiliary variables
u = runif(N);
s = scps_coord(p,X,u); # select sample
plot(X[,1],X[,2]); # plot population
points(X[s,1],X[s,2], pch=19); # plot sample
}
Run the code above in your browser using DataLab