a <- psp(runif(20),runif(20),runif(20),runif(20), window=owin())
plot(a)
# thinning
id <- sample(c(TRUE, FALSE), 20, replace=TRUE)
b <- a[id]
plot(b, add=TRUE, lwd=3)
# trimming
plot(a)
w <- owin(c(0.1,0.7), c(0.2, 0.8))
b <- a[,w]
plot(b, add=TRUE, col="red")
Run the code above in your browser using DataLab