Learn R Programming

graphlayouts (version 1.2.2)

layout_spectral: spectral graph layouts

Description

Using a set of eigenvectors of matrices associated with a graph as coordinates

Usage

layout_with_eigen(g, type = "laplacian", ev = "smallest")

layout_igraph_eigen(g, type = "laplacian", ev = "smallest", circular)

Value

matrix of xy coordinates

Arguments

g

igraph object

type

matrix to be used for spectral decomposition. either 'adjacency' or 'laplacian'

ev

eigenvectors to be used. Either 'smallest' or 'largest'.

circular

not used

Author

David Schoch

Details

The layout_igraph_* function should not be used directly. It is only used as an argument for plotting with 'igraph'. 'ggraph' natively supports the layout.

Examples

Run this code
library(igraph)

g <- sample_gnp(50, 0.2)

xy <- layout_with_eigen(g, type = "adjacency", ev = "largest")

xy <- layout_with_eigen(g, type = "adjacency", ev = "smallest")

xy <- layout_with_eigen(g, type = "laplacian", ev = "largest")

xy <- layout_with_eigen(g, type = "laplacian", ev = "smallest")

Run the code above in your browser using DataLab