class2Graph {classGraph}R Documentation

Build the Graph of Super Classes from an S4 Class Definition

Description

From an S4 class definition class, computes the graph of all super classes, i.e., of all classes that class extends.

Usage

class2Graph(class, fullNames = TRUE, simpleOnly = FALSE,
            bottomUp = FALSE, package = class@package)

Arguments

class

class name

fullNames

logical indicating if full name should be applied....

simpleOnly

logical, simply passed to getAllSuperClasses(..).

bottomUp

logical indicating the direction of the graph.

package

package where the super classes should be gotten from.

Value

an R object inheriting from class graph.

Author(s)

Robert Gentleman (original code) and Martin Maechler

See Also

classTree which builds the graph of all subclasses.

Examples

require("graph")
cg <- class2Graph("graphNEL") # simple :  graphNEL |-> graph
plot(cg)

if(require("Matrix")) {
   cg2 <- class2Graph("dgCMatrix")
   as(cg2, "sparseMatrix")
   plot(cg2)
   ## alternative: don't show the initial "Matrix:"
   cg2. <- class2Graph("dgCMatrix", fullNames=FALSE)
   plot(cg2.)
   ## 'simpleOnly' does not change anything here :
   stopifnot(identical(cg2.,
          class2Graph("dgCMatrix", fullNames=FALSE, simpleOnly = TRUE)))


   ## very simple, since "sparseMatrix" only extends "Matrix" :
   cg3 <- class2Graph("sparseMatrix")
   plot(cg3)
}

[Package classGraph version 0.7-6 Index]