[R] uniform and clumped point plots

Jim Lemon jim at bitwrit.com.au
Sat May 20 00:57:42 CEST 2006


Beutel, Terry S wrote:
 >
 > 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.

Hi Terry,

Not sure exactly what you are trying to do, but if you want to space out 
overlying points, you might find cluster.overplot in the plotrix package 
useful.

On the other hand, if you want coordinate pairs that are more evenly 
spaced, maybe something like this:

xy<-cbind(sample(seq(0,1,length=101),100,TRUE),
  sample(seq(0,1,length=101),100,TRUE))

Jim

PS Did you mean "contiguously"?




More information about the R-help mailing list