Re: [R] voronoi tessellations

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Thu 20 Jul 2006 - 06:32:43 EST

On 7/19/2006 4:21 PM, binabina@bellsouth.net wrote:
> Okay, been working with tripack, seems the most mature package for this. Got it to work well with their test data set - data(tritest). When i tried random numbers to explore further, i am getting some results that don't reconcile.
>
> example run this:
>
> library(tripack)
> y <- runif(100)
> x <- runif(100)
> vm <- voronoi.mosaic(x,y)
> plot(vm)
> par(new=T)

Don't do that! That throws away the coordinate system that has already been established. Do it this way:

library(tripack)
y <- runif(100)
x <- runif(100)
vm <- voronoi.mosaic(x,y)
plot(vm)
points(x,y,col='blue')

and if you want the axes,

axis(1)
axis(2)
box()

Duncan Murdoch

> plot(x,y,col='blue')
>
> when you look at the plot of the mosaic overlayed with the raw data, the mosaic should have each data point in 1 cell, however that is not the case - any help would be appreciated.
>
> However if you run
>
> data(tritest)
> x <- tritest$x
> y <- tritest$y
> vm <- voronoi.mosaic(x,y)
> plot(vm)
> par(new=T)
> plot(x,y,col='blue')
>
> it looks at it should.
>
> -zubin
>
>

>> From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
>> Date: 2006/07/19 Wed AM 03:15:51 EDT
>> To: Don MacQueen <macq@llnl.gov>
>> CC: zubin <binabina@bellsouth.net>,  r-help@stat.math.ethz.ch
>> Subject: Re: [R] voronoi tessellations
>>
>> On Tue, 18 Jul 2006, Don MacQueen wrote:
>>
>>> I'll suggest going to the CRAN packages page and doing a search for "voronoi".
>> The problem here is that `Voronoi tessellation' is a secondary name.  The 
>> concept has many names, including Dirichlet tessellation and Thiessen 
>> polygons, and Dirichlet has priority over Voronoi.
>>
>>> Also, search for 'triangulation', since that is one of the uses of them.
>> I know of packages deldir, tripack and perhaps geometry.
>>
>>> -Don
>>>
>>> At 11:46 PM -0400 7/18/06, zubin wrote:
>>>> Hello, looking to draw a voronoi tessellations in R - can anyone
>>>> recommend a package that has tackled this?
>>>>
>>>> some background:
>>>>
>>>> i have a economic data set and created a sammons projection, like to now
>>>> overlay a voronoi tessellation over the sammons 2-D solution for a slick
>>>> visual, and potentially color each tessellation element based on a metric.
>>>>
>>>> home.u <- unique(home1)
>>>> home.dist <- dist(home.u)
>>>> home.sam <- sammon(home.dist,k=2)
>>>> plot(home.sam$points)
>> Wait a minute.  If this is sammon() from MASS (uncredited), it is not a 
>> projection, and there is no relevant concept of distance between points in 
>> the mapped space apart from between the supplied points.
>>
>> I suggest Zubin reads carefully the reference whose support software he 
>> appears to be using.  (It would also have answered his question.)
>>
>> -- 
>> Brian D. Ripley,                  ripley@stats.ox.ac.uk
>> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>> University of Oxford,             Tel:  +44 1865 272861 (self)
>> 1 South Parks Road,                     +44 1865 272866 (PA)
>> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>>

>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Jul 20 06:55:35 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 Thu 20 Jul 2006 - 08:22:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.