Learn R Programming

multigraph (version 1.0)

stsm: Stress Majorization Layout

Description

A function to compute the graph coordinated system with a stress majorization layout algorithm.

Usage

stsm(net, seed = seed, maxiter = 40, drp, jitter, method, ...)

Value

A data frame with a coordinated system with two columns representing the abscissa and the ordinate in a two-dimensional rectangular Cartesian coordinate system.

Arguments

net

Array for network relations.

seed

(mandatory) the seed of the initial layout (see details).

maxiter

(optional) Maximum number of iterations.

drp

(optional, for valued networks) Drop values less than specified.

jitter

(optional) The amount of jitter to add on coordinates.

method

(optional, default binary) Initial distance method for graph vertices.

...

Additional argument items.

Details

Like the function frcd, this routine serves as an internal tool for graph visualization. It is also designed to establish the coordinate system using the coord option within the multigraph and bmgraph functions.

In this scenario, the graph's coordinate system commences with nodes randomly positioned, and if NULL is entered in the seed argument. An initial seed will be generated based on the computer clock watch where the number of iterations in maxiter is \(40\).

References

Gansner, E.R., Koren, Y., & North, S. Graph drawing by stress majorization. In Graph Drawing 2004: 12th International Symposium, New York, NY, USA, revised selected papers. Springer. pp. 239-250. 2005.

See Also

multigraph, bmgraph, frcd, conc

Examples

Run this code
# Two binary relations among three elements
arr <- round( replace( array(runif(18), c(3,3,2)), array(runif(18),
       c(3,3,2))>.5, 3 ) )

# Coordinates for stress majorization layout with random start
coord <- stsm(arr, seed = NULL)

# Plot multigraph with stress majorization coordinates
multigraph(arr, coord = coord)

Run the code above in your browser using DataLab