set.seed(179)
x <- runif(100)
y <- runif(100)
dxy <- deldir(x,y,rw=c(0,1,0,1))
ixy1 <- tileInfo(dxy)
print(ixy1)
ixy2 <- tileInfo(dxy,bndry=TRUE)
print(ixy2)
if(require(polyclip)) {
CP <- list(x=c(0.49,0.35,0.15,0.20,0.35,0.42,
0.43,0.62,0.46,0.63,0.82,0.79),
y=c(0.78,0.86,0.79,0.54,0.58,0.70,
0.51,0.46,0.31,0.20,0.37,0.54))
ixy3 <- tileInfo(dxy,clipp=CP)
options(width=120) # And enlarge the console window.
print(ixy3) # 33 tiles are retained.
print(ixy3$perimeters$perComps) # The tiles for points 9 and 94 have
# been split into two components.
}
Run the code above in your browser using DataLab