Hello all, I'm having a spot of trouble. I have made a very nice distance matrix from some comparison calculations. However, the matrix is 3096 x 3096, so it's relatively large. Currently I'm using the svn package as it seems to work for my data. The graph package errors and says the "adjacency matrix must be symmetric for undirected graphs". I though 3096 x 3096 was symmetric?? However, the with the svn package the gplot command has been running for 6hr's now and no end in sight :) . Is there another package that i can use or a way to speed up the analysis, or even another way of displaying the data than the nodes and edges plot? Cheers, Paul
On 9/10/2007, at 12:04 PM, H. Paul Benton wrote:> Hello all, > > I'm having a spot of trouble. I have made a very nice distance > matrix from some comparison calculations. However, the matrix is > 3096 x > 3096, so it's relatively large. Currently I'm using the svn package as > it seems to work for my data. The graph package errors and says the > "adjacency matrix must be symmetric for undirected graphs". I though > 3096 x 3096 was symmetric??NO!!!! That's ***square***, not symmetric. To be symmetric a matrix must satisfy a[i,j] = a[j,i] for all i and j. In terms of distance, that says that the distance from A to B is the same as the distance from B to A. This is often (almost always?) expected of a distance measure. If your distance measure is or should be symmetric, then there is something wrong with your distance matrix. It could simply be a matter of numerical noise or it could be a programming error. If it really makes sense that your distances are not symmetric, then you're stuck with using svn or something else that handles asymmetry. I know nothing about this area so don't ask ***me***!> However, the with the svn package the gplot command has been > running for > 6hr's now and no end in sight :) . Is there another package that i can > use or a way to speed up the analysis, or even another way of > displaying > the data than the nodes and edges plot?Off hand I would've thought that ***any*** display base on a 3096 x 3096 matrix would be totally opaque no matter how it was structured. As the signature file of someone who posts regularly to this list says ``What problem are you trying to solve?'' cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
Paul, if you have large graphs the igraph package might help, it works very well with large sparse graphs. To convert an adjacency matrix (A) to an igraph graph object (g) you can simply use library(igraph) g <- graph.adjacency(A) and then you can generate layouts with layout.fruchterman.reingold (or some other layout function), Fruchterman-Reingold should work for your graph, but it might take a couple of minutes. You can even weight the edges and then larger weights forces the adjacenct vertices to be placed closer to each other. For plotting the graphs see ?plot.igraph, ?tkplot and ?rglplot and also ?igraph.plotting for the fine bits. Gabor On Mon, Oct 08, 2007 at 04:04:00PM -0700, H. Paul Benton wrote:> Hello all, > > I'm having a spot of trouble. I have made a very nice distance > matrix from some comparison calculations. However, the matrix is 3096 x > 3096, so it's relatively large. Currently I'm using the svn package as > it seems to work for my data. The graph package errors and says the > "adjacency matrix must be symmetric for undirected graphs". I though > 3096 x 3096 was symmetric?? > However, the with the svn package the gplot command has been running for > 6hr's now and no end in sight :) . Is there another package that i can > use or a way to speed up the analysis, or even another way of displaying > the data than the nodes and edges plot? > > Cheers, > > Paul > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Csardi Gabor <csardi at rmki.kfki.hu> MTA RMKI, ELTE TTK