Reputation: 20045
I would like to convert a Voronoi mosaic into an undirected graph using R. How?
library(mvtnorm)
library(tripack)
set <- rmvnorm(100,c(0,0),diag(2))
voronoi <- (voronoi.mosaic(set[,1],set[,2]))
plot(voronoi)
1,2
2,3
3,4
1,4
...
I would prefer to use R but in case you have a nifty solution in another language I'd like to hear about it.
Upvotes: 0
Views: 311
Reputation: 13883
The igraph
package is a fairly complete graph analysis package. It has a variety of functions for creating graphs out of different data structures. In your case I think you'll want the function graph.edgelist
.
Upvotes: 1