
Hi Roger, I forgot to mention I did try tripack and did go through your previous post. 

But I'm doing a simulation and I have to repeat the process >1000 times. 


I feel using the voronoi method to divide up the study area may not be the most efficient way. I thought of dividing the area into grids(by generating random x-coor and y-coor). But the tricky part is that the study region is NOT rectangular. If I do 5*4=20 grids, since there're empty areas, I may have fewer than 20 regions at the end.....



I wonder how people divide their study area into a specific number of groups when the study region is not rectangular?

Thanks!

K.









On Sun, 24 Jun 2007, Kitty Lee wrote:

> Dear R-users,
>
> I have a study area (with points as observations) and I want to divide the space randomly into sub-regions for further analyses.
>
> I first generated some random points and then used voronoi to divide the space.
>
> ngrp<-20
> genx<-runif(ngrp,0,1)
> geny<-runif(ngrp,0,1)
> genxy<-cbind(genx, geny)
> vonout<-voronoi.mosaic(genxy[,1], genxy[,2],
> duplicate="remove")
> plot(vonout)
> vonpoly<-voronoi.polygons(vonout)
> plot(vonpoly)
>
> But there is one major problem with this method--- I wanted to get 20 sub-regions but (in one random run),  only 12 enclosed polygons are returned
>
> My questions are:
>
> 1) how can I make the unenclosed areas into enclosed polygons? (so that the whole study area is divided into mutually exclusive and exhaustive sub-regions)
>
> 2) is this a good/efficient method?

Please do note what I wrote in my earlier reply, of 20 June, use deldir 
not tripack. Then read the thread referenced from:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/96588.html

for the reamaining questions.


Roger

 
---------------------------------


	[[alternative HTML version deleted]]


