Hi,
I am new to R and I am trying to plot a minimum spanning tree from a
distance matrix. The following code will plot the minimum spanning
tree for me, however, genomes that have a distance of 0 between them
in the distance matrix are plotted as two separate nodes on the
minimum spanning tree i.e. there is an edge that links them. What I
would like to do is to plot nodes which are separated by distance of 0
as the same node ? however I am having trouble achieving this

library(ade4)
library(graph)
library(Rgraphviz)
mat <- read.table("SquareMatrixOfDistancefor106SNPs.txt")
M <- neig2mat(mstree(as.dist(mat)))
rownames(M) <- colnames(M) <- rownames(mat)
myGraph <- as(M, "graphNEL")
plot(myGraph)

Thank you
Angela

______________________________________________
R-help@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.

Reply via email to