Learn R Programming

RnavGraph (version 0.1.8)

ng_graph: Create an NG_data object to be used by a navGraph session

Description

NG_graph objects wrap the transition graphs and additional information such as graph name and graph layout.

The node names of the graph split by the chosen sep character sting must match either the variable names- or the short names of the NG_data object.

Usage

ng_graph(name, graph, sep = ":", layout = "circle")

Arguments

name
Name of graph. This name will be displayed in the pull down menu within a navGraph session.
graph
Undirected graph objects of class graph. See the package graph.
sep
Node names represent a set of variables whose name are separated by the character string sep (containing no spaces).
layout
One of the following strings: "circle", "kamadaKawaiSpring", "fruchtermanReingold" or "random".

Value

NG_graph object.

Details

The number of sep occurrences in each node name of the graph must be the same.

See Also

navGraph, newgraph, completegraph, linegraph, complement, ng_get-methods, ng_set-methods

Examples

Run this code
G <- completegraph(LETTERS[1:4])
LG <- linegraph(G, sep = "++")

ng.lg <- ng_graph("3d transition", LG, "++", "fruchtermanReingold" )
plot(ng.lg)

## If you have the Rgraphviz package working, plot graph object of class graph
## Not run: library(Rgraphviz)
## Not run: plot(LG)


Run the code above in your browser using DataLab