R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("tripack-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('tripack') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "add.constraint" > > ### * add.constraint > > flush(stderr()); flush(stdout()) > > ### Name: add.constraint > ### Title: Add a constraint to an triangulaion object > ### Aliases: add.constraint > ### Keywords: spatial > > ### ** Examples > > # we will use the simple test data from TRIPACK: > data(tritest) > tritest.tr<-tri.mesh(tritest) > opar<-par(mfrow=c(2,2)) > plot(tritest.tr) > # include all points in a big triangle: > tritest.tr<-add.constraint(tritest.tr,c(-0.1,2,-0.1), + c(-3,0.5,3),reverse=TRUE) > # insert a small cube: > tritest.tr <- add.constraint(tritest.tr, c(0.4, 0.4,0.6, 0.6), + c(0.6, 0.4,0.4, 0.6), + reverse = FALSE) > par(opar) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "cells" > > ### * cells > > flush(stderr()); flush(stdout()) > > ### Name: cells > ### Title: extract info about voronoi cells > ### Aliases: cells > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.vm <- voronoi.mosaic(tritest$x,tritest$y) > tritest.cells <- cells(tritest.vm) > # higlight cell 12: > plot(tritest.vm) > polygon(t(tritest.cells[[12]]$nodes),col="green") > # put cell area into cell center: > text(tritest.cells[[12]]$center[1], + tritest.cells[[12]]$center[2], + tritest.cells[[12]]$area) > > > > cleanEx(); ..nameEx <- "convex.hull" > > ### * convex.hull > > flush(stderr()); flush(stdout()) > > ### Name: convex.hull > ### Title: Return the convex hull of a triangulation object > ### Aliases: convex.hull > ### Keywords: spatial > > ### ** Examples > > # rather simple example from TRIPACK: > data(tritest) > tr<-tri.mesh(tritest$x,tritest$y) > convex.hull(tr,plot.it=TRUE) > # random points: > rand.tr<-tri.mesh(runif(10),runif(10)) > plot(rand.tr) > rand.ch<-convex.hull(rand.tr, plot.it=TRUE, add=TRUE, col="red") > # use a part of the quakes data set: > data(quakes) > quakes.part<-quakes[(quakes[,1]<=-17 & quakes[,1]>=-19.0 & + quakes[,2]<=182.0 & quakes[,2]>=180.0),] > quakes.tri<-tri.mesh(quakes.part$lon, quakes.part$lat, duplicate="remove") > plot(quakes.tri) > convex.hull(quakes.tri, plot.it=TRUE, add=TRUE, col="red") > > > > cleanEx(); ..nameEx <- "identify.tri" > > ### * identify.tri > > flush(stderr()); flush(stdout()) > > ### Name: identify.tri > ### Title: Identify points in a triangulation plot > ### Aliases: identify.tri > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.tr<-tri.mesh(tritest$x,tritest$y) > plot(tritest.tr) > identify.tri(tritest.tr) numeric(0) > > > > cleanEx(); ..nameEx <- "in.convex.hull" > > ### * in.convex.hull > > flush(stderr()); flush(stdout()) > > ### Name: in.convex.hull > ### Title: Determines if points are in the convex hull of a triangulation > ### object > ### Aliases: in.convex.hull > ### Keywords: spatial > > ### ** Examples > > # example from TRIPACK: > data(tritest) > tr<-tri.mesh(tritest$x,tritest$y) > in.convex.hull(tr,0.5,0.5) [1] TRUE > in.convex.hull(tr,c(0.5,-1,1),c(0.5,1,1)) [1] TRUE FALSE TRUE > # use a part of the quakes data set: > data(quakes) > quakes.part<-quakes[(quakes[,1]<=-10.78 & quakes[,1]>=-19.4 & + quakes[,2]<=182.29 & quakes[,2]>=165.77),] > q.tri<-tri.mesh(quakes.part$lon, quakes.part$lat, duplicate="remove") > in.convex.hull(q.tri,quakes$lon[990:1000],quakes$lat[990:1000]) [1] FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE > > > > cleanEx(); ..nameEx <- "neighbours" > > ### * neighbours > > flush(stderr()); flush(stdout()) > > ### Name: neighbours > ### Title: List of neighbours from a triangulation object > ### Aliases: neighbours > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.tr<-tri.mesh(tritest$x,tritest$y) > tritest.nb<-neighbours(tritest.tr) > > > > cleanEx(); ..nameEx <- "on.convex.hull" > > ### * on.convex.hull > > flush(stderr()); flush(stdout()) > > ### Name: on.convex.hull > ### Title: Determines if points are on the convex hull of a triangulation > ### object > ### Aliases: on.convex.hull > ### Keywords: spatial > > ### ** Examples > > # example from TRIPACK: > data(tritest) > tr<-tri.mesh(tritest$x,tritest$y) > on.convex.hull(tr,0.5,0.5) [1] FALSE > on.convex.hull(tr,c(0.5,-1,1),c(0.5,1,1)) [1] FALSE FALSE TRUE > # use a part of the quakes data set: > data(quakes) > quakes.part<-quakes[(quakes[,1]<=-10.78 & quakes[,1]>=-19.4 & + quakes[,2]<=182.29 & quakes[,2]>=165.77),] > q.tri<-tri.mesh(quakes.part$lon, quakes.part$lat, duplicate="remove") > on.convex.hull(q.tri,quakes.part$lon[1:20],quakes.part$lat[1:20]) [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE [13] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE > > > > cleanEx(); ..nameEx <- "outer.convhull" > > ### * outer.convhull > > flush(stderr()); flush(stdout()) > > ### Name: outer.convhull > ### Title: Version of outer which operates only in a convex hull > ### Aliases: outer.convhull > ### Keywords: spatial > > ### ** Examples > > x<-runif(20) > y<-runif(20) > z<-runif(20) > z.lm<-lm(z~x+y) > f.pred<-function(x,y) + {predict(z.lm,data.frame(x=as.vector(x),y=as.vector(y)))} > xg<-seq(0,1,0.05) > yg<-seq(0,1,0.05) > image(xg,yg,outer.convhull(xg,yg,x,y,f.pred)) > points(x,y) > > > > cleanEx(); ..nameEx <- "plot.tri" > > ### * plot.tri > > flush(stderr()); flush(stdout()) > > ### Name: plot.tri > ### Title: Plot a triangulation object > ### Aliases: plot.tri > ### Keywords: spatial > > ### ** Examples > > # random points > plot(tri.mesh(rpois(100,lambda=20),rpois(100,lambda=20),duplicate="remove")) > # use a part of the quakes data set: > data(quakes) > quakes.part<-quakes[(quakes[,1]<=-10.78 & quakes[,1]>=-19.4 & + quakes[,2]<=182.29 & quakes[,2]>=165.77),] > quakes.tri<-tri.mesh(quakes.part$lon, quakes.part$lat, duplicate="remove") > plot(quakes.tri) > # use the whole quakes data set > # (will not work with standard memory settings, hence commented out) > #plot(tri.mesh(quakes$lon, quakes$lat, duplicate="remove"), do.points=F) > > > > cleanEx(); ..nameEx <- "plot.voronoi" > > ### * plot.voronoi > > flush(stderr()); flush(stdout()) > > ### Name: plot.voronoi > ### Title: Plot a xect > ### Aliases: plot.voronoi > ### Keywords: spatial > > ### ** Examples > > # generate a random mosaic > plot(voronoi.mosaic(runif(100),runif(100),duplicate="remove")) > # use a part of the quakes data set: > data(quakes) > quakes.part<-quakes[(quakes[,1]<=-17 & quakes[,1]>=-19.0 & + quakes[,2]<=182.0 & quakes[,2]>=180.0),] > quakes.vm<-voronoi.mosaic(quakes.part$lon, quakes.part$lat, duplicate="remove") > plot(quakes.vm) > # use the whole quakes data set > # (will not work with standard memory settings, hence commented out here) > #plot(voronoi.mosaic(quakes$lon, quakes$lat, duplicate="remove")) > > > > cleanEx(); ..nameEx <- "plot.voronoi.polygons" > > ### * plot.voronoi.polygons > > flush(stderr()); flush(stdout()) > > ### Name: plot.voronoi.polygons > ### Title: plots an voronoi.polygons object > ### Aliases: plot.voronoi.polygons > ### Keywords: spatial > > ### ** Examples > > ##---- Should be DIRECTLY executable !! ---- > ##-- ==> Define data, use random, > ##-- or do help(data=index) for the standard data sets. > data(tritest) > tritest.vm <- voronoi.mosaic(tritest$x,tritest$y) > tritest.vp <- voronoi.polygons(tritest.vm) > plot(tritest.vp) > plot(tritest.vp,which=c(1,3,5)) > > > > cleanEx(); ..nameEx <- "tri.dellens" > > ### * tri.dellens > > flush(stderr()); flush(stdout()) > > ### Name: tri.dellens > ### Title: Compute the Delaunay segment lengths > ### Aliases: tri.dellens > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.vm <- voronoi.mosaic(tritest$x,tritest$y) > > tritest.vm.rejects <- voronoi.findrejectsites(tritest.vm, 0,1, 0, 1) > trilens.all <- tri.dellens(tritest.vm) > trilens.acc <- tri.dellens(tritest.vm, tritest.vm.rejects) > trilens.rej <- tri.dellens(tritest.vm, tritest.vm.rejects, inverse=TRUE) > > par(mfrow=c(3,1)) > dotchart(trilens.all, main="all Delaunay segment lengths") > dotchart(trilens.acc, main="excluding border sites") > dotchart(trilens.rej, main="only border sites") > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "tri.find" > > ### * tri.find > > flush(stderr()); flush(stdout()) > > ### Name: tri.find > ### Title: Locate a point in a triangulation > ### Aliases: tri.find > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.tr<-tri.mesh(tritest$x,tritest$y) > plot(tritest.tr) > pnt<-list(x=0.3,y=0.4) > triangle.with.pnt<-tri.find(tritest.tr,pnt$x,pnt$y) > attach(triangle.with.pnt) > lines(tritest$x[c(i1,i2,i3,i1)],tritest$y[c(i1,i2,i3,i1)],col="red") > points(pnt$x,pnt$y) > > > > cleanEx(); ..nameEx <- "tri.mesh" > > ### * tri.mesh > > flush(stderr()); flush(stdout()) > > ### Name: tri.mesh > ### Title: Create a delaunay triangulation > ### Aliases: tri.mesh > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.tr<-tri.mesh(tritest$x,tritest$y) > tritest.tr triangulation nodes with neigbours: node: (x,y): neighbours 1: (0,0) [5]: 2 3 4 7 9 2: (1,0) [5]: 1 3 5 8 10 3: (0.5,0.15) [4]: 1 2 9 10 4: (0.15,0.5) [4]: 1 7 9 12 5: (0.85,0.5) [4]: 2 8 10 11 6: (0.5,0.85) [4]: 7 8 11 12 7: (0,1) [5]: 1 4 6 8 12 8: (1,1) [5]: 2 5 6 7 11 9: (0.35,0.35) [6]: 1 3 4 10 11 12 10: (0.65,0.35) [5]: 2 3 5 9 11 11: (0.65,0.65) [6]: 5 6 8 9 10 12 12: (0.35,0.65) [5]: 4 6 7 9 11 number of nodes: 12 number of arcs: 29 number of boundary nodes: 4 boundary nodes: 1 2 7 8 number of triangles: 18 number of constraints: 0 > > > > cleanEx(); ..nameEx <- "triangles" > > ### * triangles > > flush(stderr()); flush(stdout()) > > ### Name: triangles > ### Title: Extract a list of triangle from a triangulation object > ### Aliases: triangles > ### Keywords: spatial > > ### ** Examples > > # use a slighlty modified version of data(tritest) > data(tritest2) > tritest2.tr<-tri.mesh(tritest2$x,tritest2$y) > triangles(tritest2.tr) node1 node2 node3 tr1 tr2 tr3 arc1 arc2 arc3 [1,] 1 2 3 6 2 0 7 2 1 [2,] 1 3 4 8 3 1 10 4 2 [3,] 1 4 7 9 0 2 12 3 4 [4,] 2 8 5 11 5 0 15 6 5 [5,] 2 5 10 12 6 4 16 8 6 [6,] 2 10 3 7 1 5 9 7 8 [7,] 3 10 9 17 8 6 26 11 9 [8,] 3 9 4 10 2 7 14 10 11 [9,] 4 12 7 14 3 10 19 12 13 [10,] 4 9 12 18 9 8 28 13 14 [11,] 5 8 11 16 12 4 22 17 15 [12,] 5 11 10 17 5 11 25 16 17 [13,] 6 8 7 0 14 16 18 20 23 [14,] 6 7 12 9 15 13 19 21 20 [15,] 6 12 11 18 16 14 27 24 21 [16,] 6 11 8 11 13 15 22 23 24 [17,] 9 10 11 12 18 7 25 29 26 [18,] 9 11 12 15 10 17 27 28 29 > > > > cleanEx(); ..nameEx <- "voronoi.area" > > ### * voronoi.area > > flush(stderr()); flush(stdout()) > > ### Name: voronoi.area > ### Title: Calculate area of Voronoi polygons > ### Aliases: voronoi.area > ### Keywords: spatial > > ### ** Examples > > data(tritest) > tritest.vm <- voronoi.mosaic(tritest$x,tritest$y) > tritest.vm.areas <- voronoi.area(tritest.vm) > plot(tritest.vm) > text(tritest$x, tritest$y, tritest.vm.areas) > > > > cleanEx(); ..nameEx <- "voronoi.mosaic" > > ### * voronoi.mosaic > > flush(stderr()); flush(stdout()) > > ### Name: voronoi.mosaic > ### Title: Create a Voronoi mosaic > ### Aliases: voronoi.mosaic > ### Keywords: spatial > > ### ** Examples > > # example from TRIPACK: > data(tritest) > tritest.vm<-voronoi.mosaic(tritest$x,tritest$y) > tritest.vm voronoi mosaic: nodes: (x,y): neighbours (<0: dummy node) 1: (0.5,-0.7583333): 7 2 -1 2: (0.2392857,0.1107143): 8 3 1 3: (0.1107143,0.2392857): 9 4 2 4: (-0.7583333,0.5): 10 -2 3 5: (1.758333,0.5): 11 6 -3 6: (0.8892857,0.2392857): 12 7 5 7: (0.7607143,0.1107143): 8 1 6 8: (0.5,0.30625): 17 2 7 9: (0.30625,0.5): 18 10 3 10: (0.1107143,0.7607143): 14 4 9 11: (0.8892857,0.7607143): 16 12 5 12: (0.69375,0.5): 17 6 11 13: (0.5,1.758333): -4 14 16 14: (0.2392857,0.8892857): 10 15 13 15: (0.5,0.69375): 18 16 14 16: (0.7607143,0.8892857): 11 13 15 17: (0.5,0.5): 12 18 8 18: (0.5,0.5): 15 9 17 dummy nodes: (x,y) 1: (0.5,-3.275) 2: (-3.275,0.5) 3: (4.275,0.5) 4: (0.5,4.275) > # use a part of the quakes data set: > data(quakes) > quakes.part<-quakes[(quakes[,1]<=-17 & quakes[,1]>=-19.0 & + quakes[,2]<=182.0 & quakes[,2]>=180.0),] > quakes.vm<-voronoi.mosaic(quakes.part$lon, quakes.part$lat, duplicate="remove") > quakes.vm voronoi mosaic: nodes: (x,y): neighbours (<0: dummy node) 1: (181.6603,-18.02053): 140 2 5 2: (181.6906,-18.02356): 62 3 1 3: (181.7071,-18.00231): 64 4 2 4: (181.69,-17.9425): 87 5 3 5: (181.635,-17.97): 89 1 4 6: (181.5867,-17.848): 42 7 10 7: (181.515,-17.805): 131 8 6 8: (181.4883,-17.83167): 60 9 7 9: (181.505,-17.865): 49 10 8 10: (181.5725,-17.865): 48 6 9 11: (181.4426,-17.93914): 182 12 16 12: (181.443,-17.941): 69 13 11 13: (181.485,-17.955): 136 14 12 14: (181.5,-17.94): 106 15 13 15: (181.5,-17.92125): 48 16 14 16: (181.4979,-17.92071): 50 11 15 17: (181.3258,-17.55574): 113 18 23 18: (181.2477,-17.60459): 125 19 17 19: (181.2307,-17.64976): 35 20 18 20: (181.27,-17.6825): 37 21 19 21: (181.3217,-17.65667): 110 22 20 22: (181.3475,-17.605): 26 23 21 23: (181.3546,-17.56214): 25 17 22 24: (181.4079,-17.55979): 166 25 27 25: (181.37,-17.556): 98 23 24 26: (181.3929,-17.69571): 111 27 22 27: (181.4733,-17.66889): 133 24 26 28: (181.3471,-17.75857): 119 29 34 29: (181.335,-17.795): 121 30 28 30: (181.335,-17.8325): 135 31 29 31: (181.349,-17.85): 134 32 30 32: (181.3620,-17.86081): 162 33 31 33: (181.365,-17.859): 90 34 32 34: (181.365,-17.74667): 93 28 33 35: (181.1963,-17.66125): 158 36 19 36: (181.2109,-17.73455): 169 37 35 37: (181.27,-17.705): 165 20 36 38: (181.8683,-17.63689): 65 39 43 39: (181.7557,-17.54305): 132 40 38 40: (181.5874,-17.67529): 166 41 39 41: (181.5859,-17.67818): 133 42 40 42: (181.6484,-17.81096): 6 43 41 43: (181.6941,-17.82687): 164 38 42 44: (180.0776,-16.44791): 68 45 -1 45: (181.2288,-17.25803): 118 46 44 46: (181.365,-17.21962): 97 47 45 47: (181.6647,-17.08127): 96 -2 46 48: (181.5623,-17.90567): 109 10 15 49: (181.5007,-17.86643): 61 50 9 50: (181.4836,-17.89214): 95 16 49 51: (180.5426,-18.09458): 145 52 55 52: (180.5606,-17.98647): 147 53 51 53: (180.5371,-17.92765): 156 54 52 54: (180.4204,-17.83431): 67 55 53 55: (177.5715,-20.02581): -3 51 54 56: (181.915,-17.845): 66 57 59 57: (181.965,-17.675): 65 58 56 58: (181.7659,-17.87413): 164 59 57 59: (181.8056,-17.90468): 186 56 58 60: (181.4521,-17.81357): 91 61 8 61: (181.463,-17.857): 94 49 60 62: (181.6991,-18.05206): 85 63 2 63: (181.795,-18.1): 176 64 62 64: (181.795,-17.98278): 186 3 63 65: (181.9700,-17.66013): 38 57 -4 66: (182.0112,-18.02142): 174 -5 56 67: (180.6010,-17.51833): 137 68 54 68: (180.4596,-17.14515): 115 44 67 69: (181.4271,-18.06823): 12 70 79 70: (181.3227,-18.14192): 183 71 69 71: (181.2515,-18.20125): 160 72 70 72: (181.2667,-18.26443): 179 73 71 73: (181.2805,-18.28576): 102 74 72 74: (181.4422,-18.29962): 105 75 73 75: (181.5792,-18.14306): 81 76 74 76: (181.5761,-18.12611): 184 77 75 77: (181.575,-18.125): 99 78 76 78: (181.555,-18.10833): 101 79 77 79: (181.4314,-18.06714): 171 69 78 80: (181.65,-18.105): 184 81 86 81: (181.65,-18.16667): 75 82 80 82: (181.6555,-18.17096): 130 83 81 83: (181.6862,-18.13): 180 84 82 84: (181.6939,-18.09944): 180 85 83 85: (181.6891,-18.07545): 62 86 84 86: (181.6529,-18.09357): 139 80 85 87: (181.69,-17.8575): 164 88 4 88: (181.6238,-17.95676): 124 89 87 89: (181.6321,-17.96786): 187 5 88 90: (181.3872,-17.85233): 94 91 33 91: (181.4385,-17.79081): 60 92 90 92: (181.4404,-17.78021): 131 93 91 93: (181.3675,-17.74375): 111 34 92 94: (181.4375,-17.8825): 90 95 61 95: (181.445,-17.905): 182 50 94 96: (181.66,-17.2): 132 47 98 97: (181.365,-17.47): 118 98 46 98: (181.37,-17.49): 25 96 97 99: (181.575,-18.055): 138 100 77 100: (181.575,-18.055): 141 101 99 101: (181.555,-18.055): 170 78 100 102: (181.2512,-18.61559): 142 103 73 103: (181.615,-18.83745): -6 104 102 104: (181.6793,-18.6125): 112 105 103 105: (181.6086,-18.36497): 129 74 104 106: (181.52,-17.96): 136 107 14 107: (181.5442,-17.96): 167 108 106 108: (181.5468,-17.95682): 122 109 107 109: (181.5642,-17.92637): 124 48 108 110: (181.347,-17.72): 165 111 21 111: (181.3661,-17.73589): 93 26 110 112: (181.9931,-18.39283): 177 104 -7 113: (181.1725,-17.41771): 17 114 117 114: (181.1801,-17.37939): 118 115 113 115: (180.8816,-17.34207): 68 116 114 116: (181.0585,-17.49371): 126 117 115 117: (181.1364,-17.465): 125 113 116 118: (181.1808,-17.37792): 97 45 114 119: (181.28,-17.772): 165 120 28 120: (181.2774,-17.77565): 188 121 119 121: (181.289,-17.795): 135 29 120 122: (181.58,-17.99): 168 123 108 123: (181.595,-17.975): 187 124 122 124: (181.595,-17.951): 88 109 123 125: (181.1543,-17.54861): 18 117 128 126: (181.035,-17.51917): 137 127 116 127: (181.035,-17.64944): 154 128 126 128: (181.1403,-17.62605): 158 125 127 129: (181.6779,-18.30601): 177 130 105 130: (181.6702,-18.19788): 181 82 129 131: (181.4697,-17.75971): 133 92 7 132: (181.66,-17.2465): 166 39 96 133: (181.507,-17.69133): 41 27 131 134: (181.2717,-17.85): 163 31 135 135: (181.2962,-17.81312): 121 134 30 136: (181.4975,-17.9675): 171 106 13 137: (180.6679,-17.58035): 155 126 67 138: (181.605,-18.085): 184 139 99 139: (181.619,-18.071): 86 140 138 140: (181.6252,-18.03367): 1 141 139 141: (181.605,-18.025): 185 100 140 142: (180.4018,-18.99308): 102 143 -8 143: (180.7112,-18.50518): 179 144 142 144: (180.7506,-18.18994): 148 145 143 145: (180.6091,-18.09088): 146 51 144 146: (180.7571,-17.94289): 149 147 145 147: (180.762,-17.91933): 156 52 146 148: (180.7621,-18.175): 178 149 144 149: (180.7872,-18.10364): 150 146 148 150: (181.0636,-18.07293): 178 151 149 151: (181.1053,-18.04913): 160 152 150 152: (181.0914,-18.00856): 159 153 151 153: (180.9868,-17.86618): 157 154 152 154: (180.9174,-17.81932): 127 155 153 155: (180.8233,-17.79479): 137 156 154 156: (180.7949,-17.84172): 53 147 155 157: (181.1118,-17.77237): 169 158 153 158: (181.1624,-17.65447): 35 128 157 159: (181.213,-17.887): 188 152 163 160: (181.1916,-18.12583): 71 161 151 161: (181.355,-17.897): 183 162 160 162: (181.355,-17.88): 32 163 161 163: (181.2317,-17.88): 134 159 162 164: (181.6952,-17.82872): 87 58 43 165: (181.28,-17.72): 119 110 37 166: (181.5101,-17.50139): 24 40 132 167: (181.535,-18.015): 170 168 107 168: (181.58,-18.015): 185 122 167 169: (181.2034,-17.75202): 188 36 157 170: (181.525,-18.025): 167 171 101 171: (181.4725,-18.0425): 136 79 170 172: (181.7975,-18.13): 181 173 176 173: (181.8675,-18.27): 177 174 172 174: (181.9873,-18.03038): 66 175 173 175: (181.9619,-18.02905): 186 176 174 176: (181.8,-18.11): 63 172 175 177: (181.8682,-18.27882): 129 112 173 178: (180.9523,-18.175): 179 150 148 179: (180.8482,-18.40393): 178 143 72 180: (181.755,-18.13): 181 84 83 181: (181.775,-18.135): 180 130 172 182: (181.4406,-17.93593): 95 183 11 183: (181.3939,-17.92816): 161 70 182 184: (181.593,-18.105): 80 138 76 185: (181.605,-18.025): 187 168 141 186: (181.8127,-17.96120): 59 64 175 187: (181.605,-17.995): 123 185 89 188: (181.2423,-17.78442): 120 169 159 dummy nodes: (x,y) 1: (177.4639,-12.85899) 2: (183.9572,-13.27914) 3: (173.9640,-22.61379) 4: (186.2833,-16.6081) 5: (186.4412,-18.31674) 6: (183.3786,-22.91193) 7: (186.3752,-19.10619) 8: (177.0343,-21.88635) > > > > cleanEx(); ..nameEx <- "voronoi.polygons" > > ### * voronoi.polygons > > flush(stderr()); flush(stdout()) > > ### Name: voronoi.polygons > ### Title: extract polygons from a voronoi mosaic > ### Aliases: voronoi.polygons > ### Keywords: spatial > > ### ** Examples > > ##---- Should be DIRECTLY executable !! ---- > ##-- ==> Define data, use random, > ##-- or do help(data=index) for the standard data sets. > > data(tritest) > tritest.vm <- voronoi.mosaic(tritest$x,tritest$y) > tritest.vp <- voronoi.polygons(tritest.vm) > tritest.vp [[1]] x y [1,] 0.5000000 0.3062500 [2,] 0.2392857 0.1107143 [3,] 0.5000000 -0.7583333 [4,] 0.7607143 0.1107143 [[2]] x y [1,] 0.3062500 0.5000000 [2,] 0.1107143 0.7607143 [3,] -0.7583333 0.5000000 [4,] 0.1107143 0.2392857 [[3]] x y [1,] 0.8892857 0.7607143 [2,] 0.6937500 0.5000000 [3,] 0.8892857 0.2392857 [4,] 1.7583333 0.5000000 [[4]] x y [1,] 0.5000000 1.7583333 [2,] 0.2392857 0.8892857 [3,] 0.5000000 0.6937500 [4,] 0.7607143 0.8892857 [[5]] x y [1,] 0.5000000 0.5000000 [2,] 0.5000000 0.5000000 [3,] 0.3062500 0.5000000 [4,] 0.1107143 0.2392857 [5,] 0.2392857 0.1107143 [6,] 0.5000000 0.3062500 [[6]] x y [1,] 0.7607143 0.1107143 [2,] 0.5000000 0.3062500 [3,] 0.5000000 0.5000000 [4,] 0.6937500 0.5000000 [5,] 0.8892857 0.2392857 [[7]] x y [1,] 0.6937500 0.5000000 [2,] 0.5000000 0.5000000 [3,] 0.5000000 0.5000000 [4,] 0.5000000 0.6937500 [5,] 0.7607143 0.8892857 [6,] 0.8892857 0.7607143 [[8]] x y [1,] 0.1107143 0.7607143 [2,] 0.2392857 0.8892857 [3,] 0.5000000 0.6937500 [4,] 0.5000000 0.5000000 [5,] 0.3062500 0.5000000 attr(,"class") [1] "voronoi.polygons" > > > > ### *