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? Thanks for your help Pascal
Is the contributed package `deldir' on CRAN what you're looking for? HTH, andy> From: Pascal A. Niklaus [mailto:Pascal.Niklaus at unibas.ch] > 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? > > Thanks for your help > > Pascal
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 at 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 at nhh.no
"Pascal A. Niklaus" <Pascal.Niklaus at unibas.ch> writes:> 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.Voronoi Tesselation, unless my memory is failing me (again...)> Is there a function somewhere in a R package that may do this?package deldir will do VTs. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907