[R] Voronoi-Diagrams in R

Raphael Päbst raphael.paebst at gmail.com
Tue May 20 20:04:43 CEST 2014


Thank you very much, this looks promising.

I have a follow-up question however, probably due to my thickness when
it comes to the underlying math.

I am translating (as closely as possible) some code that has
originally been written for Mathlab and uses the delaunay() function
there. Now, if I understand it correctly, Mathlab uses the same
Qhull-Library as a basis, as does the Geometry-Package. So in theory
delaunay(x) in Mathlab and delaunay(x) in R should give me the same
results for the same x, where x is a matrix of coordinates.

If I use deldir(x1, x2) where x1 and x2 are the first and second
column of that same matrix above, is there any chance to get the same
result as with delaunayn() or at least something similar in format to
the result of delaunayn()?

Many thanks again and please excuse my crude english.

Raphael
On 5/14/14, Boris Steipe <boris.steipe at utoronto.ca> wrote:
> Try:
>
> install.packages("deldir")
> library(deldir)
> ?deldir
> set.seed(16180)
> x <- runif(20); y <- runif(20); window <- c(0,1,0,1)
> tess <- deldir(x, y, rw = window)
> plot.deldir(tess, wpoints="real", wlines="tess")
>
> Cheers,
> Boris
>
>
> On 2014-05-14, at 8:18 AM, Raphael Päbst wrote:
>
>> Hello everyone!
>> I have returned to R after a longish break and am currently working on
>> a project where I need Delaunay-Triangulations and Voronoi-Diagrams.
>> If I understood it correctly, the Geometry-Package only offers
>> functions for the Delaunay-Triangulation at the moment. Is this
>> correct and if so, what would be the best way to get Voronoi-Diagrams
>> as well?
>>
>> Many Thanks in advance!
>>
>> Raphael
>>
>> ______________________________________________
>> R-help at r-project.org 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 at r-project.org 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.
>



More information about the R-help mailing list