mbojan / intergraph

R package for converting network data objects between different classes
https://mbojan.github.io/intergraph
21 stars 4 forks source link

as.matrix.igraph does not seem to work #2

Closed mbojan closed 10 years ago

mbojan commented 10 years ago

Submitted by DE. The result when I use the function as.matrix in "intergraph" is not what I expected. Could you give me some advice?

g1 <- as.matrix(exIgraph, "adjacency")
class(g1)
# [1] "igraph"
g1
#      [,1]      
#  [1,] 15        
# [2,] TRUE      
# [3,] Numeric,11
# [4,] Numeric,11
# [5,] Numeric,11
# [6,] Numeric,11
# [7,] Numeric,16
# [8,] Numeric,16
# [9,] List,4    
attr(,"class")
# [1] "igraph"

As I understand, I think "as.matrix" can convert the form "igraph" into "matrix", but the result is not.

mbojan commented 10 years ago

Method as.matrix.igraph in "intergraph" seems to work correctly. Looks like submitter did not have the package "intergraph" attached.