# \donttest{
nx<-100; ny<-4; #try also nx<-1000; ny<-10;
e<-.15;
#try also e<-1.1; #closer to CSR than association, as e is large
#Y points uniform in unit square
Y<-cbind(runif(ny),runif(ny))
Xdt<-rassoc.matern(nx,Y,e)
Xdt
summary(Xdt)
plot(Xdt,asp=1)
Xdt<-Xdt$gen.points
Xlim<-range(Xdt[,1],Y[,1]);
Ylim<-range(Xdt[,2],Y[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Y,asp=1,xlab="x",ylab="y",
main="Matern-like Association of X points with Y Points",
xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),
pch=16,col=2,lwd=2)
points(Xdt)
a1<-0; a2<-10;
b1<-0; b2<-5;
e<-1.1;
#Y points uniform in a rectangle
Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2))
#try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2))
Xdt<-rassoc.matern(nx,Y,e)$gen.points
Xlim<-range(Xdt[,1],Y[,1]);
Ylim<-range(Xdt[,2],Y[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Y,asp=1,xlab="x",ylab="y",
main="Matern-like Association of X points with Y Points",
xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16,col=2,lwd=2)
points(Xdt)
# }
Run the code above in your browser using DataLab