0

I want to voronoi diagrams in R. I have a set of points in N-dimensions(say 10). I dont want to use multi dimensional scaling(MDS). I want voronoi diagrams to be plotted using non metric measures. Is there any package which has this implementation? If not, then can you suggest me a suitable way to plot the tessellations using these N-dimensional co-ordinates.

Vincent Zoonekynd
  • 31,893
  • 5
  • 69
  • 78
dp758
  • 106
  • 10
  • 2
    What have you tried? I tried this library('sos');findFn('voronoi'); you find at least 5 or 6 manners to do this. – agstudy Feb 06 '13 at 13:31
  • did you google, `voronoi diagrams in R`? Is the [first google hit](https://www.google.co.uk/#hl=en&safe=off&tbo=d&output=search&sclient=psy-ab&q=voronoi+diagrams+in+R&oq=voronoi+diagrams+in+R&gs_l=hp.3..0i22l4.799.799.0.1496.1.1.0.0.0.0.81.81.1.1.0.les%3B..0.0...1c.1.2.hp.jsUQeMChiXU&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&bvm=bv.41934586,d.d2k&fp=6dd168543f42aaad&biw=944&bih=951): "package `geometry`" useful or not? Help us not travel the same ground you have already covered. If you have covered any. – user1317221_G Feb 06 '13 at 13:32
  • Do you want to map points to your visualization space (2D or 3D) and tessellate there, or do you want to tessellate in all 10 dimensions and visualize that? The latter will be far more difficult, I guess. For the former, PCA comes to my mind. – MvG Feb 06 '13 at 13:33
  • I want to plot it in 2D only. I dont want to use sammons or any other multidimensional scaling approaches as I will lose information. – dp758 Feb 06 '13 at 13:47
  • 1
    You cannot map ten continuous dimensions to two without loosing information. You can only influence what information you preserve and what you loose. – MvG Feb 06 '13 at 13:49
  • I know about the package geometry but it does not tell me how to plot them. I used "delaunayn" function but it doesnt give me the coordinates in 2d. – dp758 Feb 06 '13 at 13:50
  • @MvG: Right. But I will lose less information and get more meaningful tessellations if i use non metric distances. – dp758 Feb 06 '13 at 13:53
  • I have used voronoi function and deldir. These functions take the 2d coordinates to give voronoi plot. All i want is conversion of a 10d data into 2d using non metric distances in r, so that i can give it as input to the above functions or a function itself which does the 10d to 2d conversion and gives the voronoi plot as well – dp758 Feb 06 '13 at 14:03
  • This is quite an interesting problem. I would guess your chance of success hinges upon the nature of your data - some ten-dimensional Delaunay topologies may reduce to two dimension much better than others. In any case, you will probably get better answers on a mathematics forum than a programming one. – Tom Anderson Feb 06 '13 at 14:29

1 Answers1

3

It is not clear whether your problem is the dimension reduction or plotting the tessellation: the problems are separate. As suggested in the comments, you can use

library(sos)
???"non-metric"
???"Voronoi"

to find where the functions you need are.

# Sample data: a distance matrix
d <- dist( matrix( rnorm(200), nc=10 ) )

# Dimension reduction, via non-metric multidimensional scaling
library(MASS)
r <- sammon( d )

# Plot the Voronoi tessellation
library(tripack)
x <- r$points
plot( voronoi.mosaic(x[,1], x[,2]) )
points(x, pch=13)

Besides principal component analysis (prcomp) and multidimensional scaling (MASS::isoMDS, MASS:sammon), you can also look at isomap (vegan::isomap), local linear embedding (lle::lle), maximum variance unfolding or T-distributed stochastic neighbor embedding (tsne::tsne): since some of those (Isomap, LLE, MVU) are based on the "neighbourhood graph", which is not unlike the 2-dimensional tessellation you seek, they may be more meaningful for your problem.

Vincent Zoonekynd
  • 31,893
  • 5
  • 69
  • 78
  • No. I dont want dimension reduction using multidimension scaling. I want using non metric distances such as convex distances. – dp758 Feb 06 '13 at 14:24
  • I have edited my answer: you can use, for instance, `sammon` instead of `isoMDS`, for non-metric multidimensional scaling. – Vincent Zoonekynd Feb 06 '13 at 14:29
  • sammon's projection is also multidimensional scaling. But I will look into the various other projections which you have told. Thanks a lot – dp758 Feb 06 '13 at 15:28