Learn R Programming

hyperdraw (version 1.24.0)

graphLayout: Layout a graph.

Description

This function is designed to layout a graph using the Rgraphviz package. The hyperdraw package makes this a generic function with a method for graphBPH objects. The function of the same name in the Rgraphviz package is used as a method for Ragraph objects.

Usage

graphLayout(graph, layoutType, ...)

Arguments

graph
An graphBPH object, which is to be laid out.
layoutType
The layout method (e.g., dot or neato).
...
These arguments will be passed to the agopen() function.

Value

An RagraphBPH object.

References

Gansner, E.R. and and North, S.C. (1999) An open graph visualization system and its applications to software engineering, Software - Practice and Experience, 30:1203--1233.

Gentry, J. and Long, L. and Gentleman, R. and Falcon, S. and Hahne, F. and Sarkar, D. and Hansen, K. Rgraphviz: Provides plotting capabilities for R graph objects.

See Also

agopen and GraphvizLayouts

Examples

Run this code
nodes <- c(LETTERS[1:5], paste("R", 1:3, sep=""))
testgnel <- new("graphNEL",
                nodes=nodes,
                edgeL=list(
                  A=list(edges=c("R1", "R2")),
                  B=list(edges="R2"),
                  C=list(),
                  D=list(edges="R3"),
                  E=list(),
                  R1=list(edges="B"),
                  R2=list(edges=c("C", "D")),
                  R3=list(edges="E")),
                edgemode="directed")
testbph <- new("graphBPH", testgnel, "^R")
testrabph <- graphLayout(testbph)

Run the code above in your browser using DataLab