SCM

SCM Repository

[matrix] Annotation of /branches/Matrix-mer2/tests/graph.R
ViewVC logotype

Annotation of /branches/Matrix-mer2/tests/graph.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 886 - (view) (download)
Original Path: pkg/tests/graph.R

1 : maechler 886 library(Matrix)
2 :     if(FALSE)
3 :     library(Matrix, lib="/u/maechler/R/Pkgs/Matrix.Rcheck") ; library(graph)
4 :    
5 :     if(require(graph)) {
6 :     example("graphNEL-class", echo = FALSE)
7 :     nodes(gR)
8 :    
9 :     ## 1) undirected
10 :     sm.g <- as(gR, "sparseMatrix")
11 :     str(sm.g)## 'dsT' - fine; even has Dimnames!
12 :     validObject(sm.g)
13 :     sm.g # should show the Dimnames - at least row ones
14 :    
15 :     ## 2) directed
16 :     gU <- gR; edgemode(gU) <- "directed"
17 :     sgU <- as(gU, "sparseMatrix")
18 :     str(sgU)## 'dgT' with dimnames
19 :     validObject(sgU)
20 :     sgU # should now show the Dimnames!
21 :     }

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge