mkClassGraph: Create graph of S4 class hierarchy

View source: R/mkClassHierarchy.R

mkClassGraphR Documentation

Create graph of S4 class hierarchy

Description

This constructs a hierarchical structure representing the inheritance relationships between between a collection of S4 classes.

Usage

mkClassGraph(pkg, addIs = TRUE, classes = getClasses(pkg),
              classDefs = structure(lapply(classes, getClass), names = classes))

Arguments

pkg

the name of the R package in which to find the S4 class definitions

addIs

a logical value controlling whether we also add the explicit 'is' relationships defined via setIs.

classes

the names of the S4 classes of interest

classDefs

the definitions of the S4 classes of interest

Value

A data.frame with two columns to and from giving the directed edges for the graph.

Author(s)

Duncan Temple Lang (?)

References

The methods package.

Examples

if(require(CodeDepends)) {
  g = mkClassGraph("package:CodeDepends")
  if(require(igraph))
     plot(as(g, "igraph"), cex.arrow.size = .3)
}

duncantl/CodeAnalysis documentation built on Feb. 21, 2024, 10:49 p.m.