layout_spectral: spectral graph layouts

layout_spectralR Documentation

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)

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

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.

Value

matrix of xy coordinates

Author(s)

David Schoch

Examples

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")

graphlayouts documentation built on Nov. 24, 2022, 9:07 a.m.