library(spatstat)
plot(c(0,1),c(0,1),type="n")
xy <- locator(20) # click on 20 points in plot window
pp <- as.ppp(xy, c(0,1,0,1))
w <- owin(c(0,1),c(0,1))
plot(w) # neater
xy <- locator(20) # click on 20 points in plot window
pp <- as.ppp(xy, w)
xy <- matrix(runif(40), ncol=2)
pp <- as.ppp(xy, c(0,1,0,1))
# Venables-Ripley format
sp <- list(x=runif(10), y=runif(10), xl=0, xu=1, yl=0, yu=1)
pp <- as.ppp(sp) # converted to our format
Run the code above in your browser using DataLab