Re: [R] uniform and clumped point plots

From: Ben Bolker <>
Date: Thu 18 May 2006 - 23:42:21 EST

Beutel, Terry S <Terry.Beutel <at>> writes:

> I am trying to generate two dimensional random coordinates.
> For randomly distributed data I have simply used
> >xy<-cbind(runif(100),runif(100))
> However I also want to generate coordinates that are more uniformly
> distributed, and coordinates that are more contagiously distributed than
> the above.

here are some pictures I made for a talk recently, using the Poisson cluster process function from "splancs" and the Strauss process from "spatial" (I think)

sq <- as.matrix(data.frame(x=c(0,1,1,0,0),y=c(0,0,1,1,0))) <- pcp.sim(rho=10,m=10,s2=0.001,region.poly=sq) plot(
n <- nrow(
p.ran <- matrix(runif(2*n),nrow=n,dimnames=list(NULL,c("x","y"))) ppregion()
p.reg <- Strauss(n,c=0.1,r=0.1)
p.reg <- matrix(c(p.reg$x,p.reg$y),nrow=n,dimnames=list(NULL,c("x","y"))) all <- data.frame(rbind(,p.ran,p.reg),

lattice.options(default.theme = ltheme) ## set as default ltheme <- col.whitebg()
ltheme$xyplot.background$col <- "transparent" ## change strip bg



  Ben Bolker mailing list PLEASE do read the posting guide! Received on Thu May 18 23:47:33 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 19 May 2006 - 02:10:10 EST.

Mailing list information is available at Please read the posting guide before posting to the list.