SCM

SCM Repository

[matrix] View of /pkg/tests/graph.R
ViewVC logotype

View of /pkg/tests/graph.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 886 - (download) (annotate)
Wed Aug 31 17:49:47 2005 UTC (13 years, 11 months ago) by maechler
File size: 556 byte(s)
new classes "index", "symmetricM*" and "triangularM*"; indexing for logical and character indices; new tests; more to do
library(Matrix)
if(FALSE)
library(Matrix, lib="/u/maechler/R/Pkgs/Matrix.Rcheck") ; library(graph)

if(require(graph)) {
    example("graphNEL-class", echo = FALSE)
    nodes(gR)

    ## 1) undirected
    sm.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) directed
    gU <- gR; edgemode(gU) <- "directed"
    sgU <- as(gU, "sparseMatrix")
    str(sgU)## 'dgT' with dimnames
    validObject(sgU)
    sgU # should now show the Dimnames!
}

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