Learn R Programming

mathgraph (version 0.9-5)

print.mathgraph: Print a Mathematical Graph

Description

Prints a representation of the graph.

Usage

## S3 method for class 'mathgraph':
print(x, prefix.node = if (is.character(xu)) "" else "node", ...)

Arguments

x
an object inheriting from mathgraph which represents a mathematical graph.
prefix.node
a string to put in front of each node named. The default is an empty string if the nodes are character and the string "node" if they are not.
...
other arguments to print may be given, but are not used.

Value

  • the input x is returned invisibly.

Details

The object is printed. A `--' between nodes means an undirected edge, while a single arrow means a directed edge.

References

S Poetry, Patrick J. Burns, Section 13.3, Mathematical Graphs

See Also

mathgraph, names.mathgraph

Examples

Run this code
mathgraph(~ 1:3 / 2:4)
mathgraph(~ 1:3 / 2:4, dir=TRUE)
jjm <- mathgraph(~ letters[1:3] * letters[2:4])
jjm
names(jjm) <- LETTERS[1:9]
jjm

Run the code above in your browser using DataLab