Re: [R] Minimum Spanning Tree

2009-04-08 Thread jpearl01
That's like a miracle! The only thing that would make this graph perfect is if the lengths of the edges were in the same ratio as the actual edge lengths from the matrix. Is it possible to alter that? Thank you!! ~josh Actually, library(igraph) tab <- read.csv("http://www.nabble.com/file/p

Re: [R] Minimum Spanning Tree

2009-04-08 Thread jpearl01
Make the graph undirected first and then choose the right plotting parameters. E.g. the following works fine for me: set.seed(2) g <- erdos.renyi.game(100, 300, type="gnm", directed=TRUE) E(g)$weight <- runif(ecount(g)) mst <- minimum.spanning.tree(g) mst <- simplify(as.undirected(mst)) lay <-

Re: [R] Minimum Spanning Tree

2009-04-08 Thread jpearl01
>I am not sure what you mean. Of course you can plot it using different >layouts, e.g. with layout.reingold.tilford (after choosing the root >vertex in some way) and then it looks like a usual tree plot, but why >would that be any better? I'd like to be able to distinguish between the nodes bett

Re: [R] Minimum Spanning Tree

2009-04-07 Thread jpearl01
There was an error in the file... an extraneous comma. That's taken care of. however, my tree prints out an image that doesn't seem like a mst. Attached is the csv file I used... http://www.nabble.com/file/p22938299/sp_matrix.csv sp_matrix.csv I'd like it to look something like the image fil

[R] Minimum Spanning Tree

2009-04-07 Thread jpearl01
Hi all, I'm very new to R and read a few tutorials, however I'm having difficulty trying to figure out how to plot a minimum spanning tree. I have a csv file that contains an n-by-n matrix of distances between strains of bacteria called matrix.csv. Looks like: id,strain1, strain2,strain3 strain1