[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    Re: [R] plot map of areas
From:       Roger Bivand <Roger.Bivand () nhh ! no>
Date:       2003-11-21 13:20:31
[Download RAW message or body]

On Fri, 21 Nov 2003, Pascal A. Niklaus wrote:

> Hi all,
> 
> Given a number of points (x,y) in a plane, I'd like to plot a map of 
> polygons, so that
> 
>     1) each polygon contains exactly one point
>     2) the polygon defines the area for which this specific point is 
> closer than any other point.
> 
> It's a bit like a map of areas "influenced" by that point, and it's 
> obviously a matter of intersecting the perpendicular bisectors between 
> adjacent points.
> 
> I believe this type of map has a name, but I can't remember how it's 
> called.
> 
> Is there a function somewhere in a R package that may do this?

Try this:

> library(tripack)
> coords <- cbind(runif(100), runif(100))
> plot(coords, pch=19, col="blue")
> plot(voronoi.mosaic(coords[,1], coords[,2], duplicate = "remove"), 
+   add=TRUE)
> 

A Voronoi diagram? There are quite a lot of relevant functions in the 
tripack package. 

> 
> Thanks for your help
> 
> Pascal
> 
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic