# NOT RUN {
glist <- list(1:3, 2:4, 4:5)
am1 <- ugList2M( glist )
am2 <- dagList2M( glist )
if (interactive() && require(Rgraphviz)){
plot(as(am1, "graphNEL"))
plot(as(am2, "graphNEL"))
}
## FIXME : This is a mess
m <- matrix(1:25, nrow=5)
M <- M2dgCMatrix(m)
m2 <- M2matrix(M)
M2 <- M2dgCMatrix(m2)
g <- ug(~ a:b + b:c)
graphNEL2M(g)
graphNEL2M(g, "dgCMatrix")
## Sparse and dense adjacency matrices converted to igraph
g1 <- ug(~a:b + b:c + c:d, result="matrix")
g2 <- ug(~a:b + b:c + c:d, result="dgCMatrix")
plot( M2igraph( g1 ) )
plot( M2igraph( g2 ) )
## Sparse and dense adjacency matrices converted to graphNEL
g1 <- ug(~a:b + b:c + c:d, result="matrix")
g2 <- ug(~a:b + b:c + c:d, result="dgCMatrix")
M2graphNEL( g1 )
M2graphNEL( g2 )
g <- list(c(1,2,3), c(2,3,4), c(4,5))
glist2setMAT(g)
# }
Run the code above in your browser using DataLab