# NOT RUN {
glist <- list(1:3, 2:4, 4:5)
am1 <- ugList2M( glist )
am2 <- dagList2M( glist )
if (interactive()){
plot(as(am1, "graphNEL"))
plot(as(am2, "graphNEL"))
}
## 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 )
## Sparse and dense adjacency matrices converted to adjacency list
g1 <- ug(~a:b + b:c + c:d, result="matrix")
g2 <- ug(~a:b + b:c + c:d, result="dgCMatrix")
M2adjList( g1 )
## M2adjList( g2 ) FAILS for sparse matrix
## Sparse and dense adjacency matrices converted to cliques
g1 <- ug(~a:b + b:c + c:d, result="matrix")
g2 <- ug(~a:b + b:c + c:d, result="dgCMatrix")
M2ugList( g1 )
M2ugList( g2 )
## Sparse and dense adjacency matrices converted to cliques
g1 <- ug(~a:b + b:c + c:d, result="matrix")
g2 <- ug(~a:b + b:c + c:d, result="dgCMatrix")
M2dagList( g1 )
## M2dagList( g2 ) ## Fails for sparse matrix
g1 <- dag(~a:b + b:c + c:d, result="matrix")
g2 <- dag(~a:b + b:c + c:d, result="dgCMatrix")
M2dagList( g1 )
## M2dagList( g2 ) ## FIXME Fails for sparse matrix
# }
Run the code above in your browser using DataLab