Learn R Programming

graphlayouts (version 0.2.0)

layout_igraph_centrality: Centrality layout

Description

arranges nodes in concentric circles according to a centrality index

Usage

layout_igraph_centrality(g, cent, scale = T, iter = 500, tol = 1e-04,
  tseq = seq(0, 1, 0.2), circular)

layout_with_centrality(g, cent, scale = T, iter = 500, tol = 1e-04, tseq = seq(0, 1, 0.2))

Arguments

g

igraph object

cent

centrality scores

scale

scale centrality between 0 and 100?

iter

number of iterations

tol

stopping criterion

tseq

transition steps

circular

not used

Value

coordinates to be used layouting a graph

Details

the layout_igraph_* function should not be used directly. It is only used as an argument for 'ggraph'.

References

Brandes, U., & Pich, C. (2011). More flexible radial layout. Journal of Graph Algorithms and Applications, 15(1), 157-173.

Examples

Run this code
# NOT RUN {
library(igraph)
library(ggraph)
g <- sample_gnp(10,0.4)
ggraph(g,layout="centrality",cent=closeness(g))+
  draw_circle(use = "cent")+
  geom_edge_link()+
  geom_node_point(shape=21,fill="grey25",size=5)+
  theme_graph()+
  coord_fixed()
# }

Run the code above in your browser using DataLab