rViewGraph: This is a function to create and start the Java graph...

Description Usage Arguments Details Value Author(s) Source Examples

Description

Creates and starts an animated GUI for positioning the vertices of a graph in 2 dimensions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
rViewGraph(object, names, layout, directed, running, ...)

## Default S3 method:
rViewGraph(object, names = seq(max(object)),
  layout = NULL, directed = FALSE, running = TRUE, ...)

## S3 method for class 'Matrix'
rViewGraph(object, names = 1:max(dim(object)),
  layout = NULL, directed = FALSE, running = TRUE, ...)

## S3 method for class 'igraph'
rViewGraph(object, names = igraph::V(object)$name,
  layout = igraph::layout.random(object),
  directed = igraph::is.directed(object), running = TRUE, ...)

Arguments

object

Object to plot graph for

names

names of the nodes

layout

layout to start

directed

is the graph directed or not

running

run the graph

...

passed along extra arguments.

Details

Creates and starts a Java GUI showing a real time animation of a Newton-Raphson optimization of a force function specified between the vertices of an arbitrary graph. There are attractive forces between adjacent vertices and repulsive forces between all vertices. The repulsions go smoothly to zero for a finite distance between vertices so that, unlike some other methods, different components don't send each other off to infinity.

This is a generic function that delegates its work to specific functions depending on the class of the first argument. It can handle an incidence matrix, a list of edges, and an igraph graph object.

Full information about mouse and key operations for manipulating the graph are given on the documentation page for the Java version of 'ViewGraph' at <http://www-genepi.med.utah.edu/~alun/software/docs/ViewGraph.html>.

Value

All versions of rViewGraph return a list of functions that control the actions of the viewer. None of the functions in the list take an argument.

run()

Starts the GUI running if it's not already doing so.

stop()

Stops the GUI running if it's running.

hide()

Stops the GUI and hides it.

show()

Shows the GUI. If it was running when hide was called, it starts running again.

getLayout()

Returns the coordinates of the vertices that are currently shown in the GUI. These are in the format that igraph expects for layouts.

Author(s)

Alun Thomas

Source

A full description of the force function and algorithm used is given by C Cannings and A Thomas, Inference, simulation and enumeration of genealogies. In D J Balding, M Bishop, and C Cannings, editors, The Handbook of Statistical Genetics. Third Edition, pages 781-805. John Wiley & Sons, Ltd, 2007.

Examples

1
2
3
4
5
6
7
8
9
# 
# Viewing an Erdos Renyui random graph specified by random edges.
f = sample(100,size=200,replace=TRUE)
t = sample(100,size=200,replace=TRUE)
vft = rViewGraph(cbind(f,t))
#
# Edges can also be specified in \code{igraph} style.
e = c(t,f)
ve = rViewGraph(e)

rviewgraph documentation built on May 2, 2019, 1:10 p.m.