[Bioc-devel] Question graph package 1.10.2

Markus Ruschhaupt m.ruschhaupt at dkfz-heidelberg.de
Mon May 15 18:23:31 CEST 2006


Hi,

I have a question regarding graph package version 1.10.2. I would like 
to transform a matrix into a graph and later on transform the graph back 
into a matrix. But when I do so, the weights of the edges seems to be 
lost. Please have a look at the example:

 > library(graph)
 > A <- matrix(c(0,0.2,1,0.2,0,0,1,0,0),ncol=3)
 > rownames(A) <- colnames(A) <- letters[1:3]
 > A

    a   b c
a 0.0 0.2 1
b 0.2 0.0 0
c 1.0 0.0 0

 > as(as(A,"graphNEL"),"matrix")
   a b c
a 0 1 1
b 1 0 0
c 1 0 0

 > sessionInfo()

Version 2.3.0 (2006-04-24)
i686-pc-linux-gnu

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
    graph    Ruuid
"1.10.2" "1.10.0"


Is this a bug or is this a feature? I also tested the graph package 1.8. 
with R.2.2.1 and this behaved as expected (the weights are included into 
the matrix).

Best,
  Markus



More information about the Bioc-devel mailing list