Rev 1806 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
if(require(graph)) {library(Matrix)if(FALSE)## for ease of developer:library(Matrix, lib="/u/maechler/R/Pkgs/Matrix.Rcheck")example("graphNEL-class", echo = FALSE)nodes(gR)## 1) undirectedsm.g <- as(gR, "sparseMatrix")str(sm.g)## 'dsT' - fine; even has Dimnames!validObject(sm.g)sm.g # should show the Dimnames - at least row ones## 2) directedgU <- gR; edgemode(gU) <- "directed"sgU <- as(gU, "sparseMatrix")str(sgU)## 'dgT' with dimnamesvalidObject(sgU)sgU # should now show the Dimnames!### Reverse : sparseMatrix -> graphif(FALSE) { ## not yet (FIXME!)gmg <- as(sm.g, "graph")gmg2 <- as(sm.g, "graphNEL")gmgU <- as(sgU, "graph")gmgU <- as(sgU, "graphNEL")}}