Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

layout_tbl_graph_auto

Automatically pick a layout based on graph type


Description

This function infers the layout from the graph structure and is the default when calling ggraph(). If an x and y argument is passed along, the manual layout is chosen. Otherwise if the graph is either a rooted tree or a rooted forest the layout will be dendrogram if the nodes contains a height variable or tree if not. If the tree is unrooted the unrooted layout will be used. If the tree is a DAG the sygiyama layout will be used. Otherwise the stress layout will be used (or sparse_tree if the graph contains more than 2000 nodes).

Usage

layout_tbl_graph_auto(graph, circular, ...)

Arguments

graph

A tbl_graph object

circular

Logical. Should the layout be transformed to a circular representation. Defaults to FALSE. Only applicable if the graph is a tree structure

...

Arguments passed on to the chosen layout

Value

A data.frame with the columns x, y, circular as well as any information stored as node variables in the tbl_graph object.

See Also


ggraph

An Implementation of Grammar of Graphics for Graphs and Networks

v2.0.5
MIT + file LICENSE
Authors
Thomas Lin Pedersen [cre, aut] (<https://orcid.org/0000-0002-5147-4711>), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.