Hello,
sorry that I interfer, but I tried to do this
The SymTest matrix:
A B C D E F G
A 0.3 0.1 0.5 0.7 0.2 0.8 0.1
B 0.1 0.5 0.4 0.6 0.7 0.3 0.7
C 0.5 0.4 0.3 0.5 0.1 0.1 0.5
D 0.7 0.6 0.5 0.4 0.3 0.5 0.7
E 0.2 0.7 0.1 0.3 0.5 0.2 0.1
F 0.8 0.3 0.1 0.5 0.2 0.3 0.5
G 0.1 0.7
Birgit Lemcke [EMAIL PROTECTED] writes:
Hello,
sorry that I interfer, but I tried to do this
The SymTest matrix:
A B C D E F G
A 0.3 0.1 0.5 0.7 0.2 0.8 0.1
B 0.1 0.5 0.4 0.6 0.7 0.3 0.7
C 0.5 0.4 0.3 0.5 0.1 0.1 0.5
D 0.7 0.6 0.5 0.4 0.3 0.5 0.7
E 0.2 0.7 0.1 0.3 0.5
Paul,
i have no idea what functionality you need from graph, but
if the igraph package can do what you want then it can
easily convert this to a graph for you, basically it is just
threshold - 0.5
g - graph.adjacency(simthreshoold)
or you can create a weighted graph:
g - graph.adjacency(sim,
Hi Paul,
H. Paul Benton [EMAIL PROTECTED] writes:
I have a matrix which gives me the similarity of each item to each
other. I would like to turn this matrix into something like what they
have in the graph package with the nodes and edges.
http://cran.r-project.org/doc/packages/graph.pdf .
Along with the example I gave using graphAM, you might also want to
look at the help page for the distGraph class which may be more
directly what you want:
library(graph)
class ? distGraph
__
R-help@stat.math.ethz.ch mailing list
Try this:
# test data
mat - structure(c(1, 0.325141612, 0.002109751, 0.250153137, 0.0223676,
1, 0.342654, 0.1987485, 0.9723831, 0.9644216, 1, 0.7391222, 0.394331,
0.5460461, 0.7080224, 1), .Dim = c(4L, 4L), .Dimnames = list(
c(a, b, c, d), c(a, b, c, d)))
library(sna)
# draw edges according