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

make_tree

Create tree graphs


Description

Create a regular tree graph.

Usage

make_tree(n, children = 2, mode = c("out", "in", "undirected"))

tree(...)

Arguments

n

Number of vertices.

children

Integer scalar, the number of children of a vertex (except for leafs)

mode

Defines the direction of the edges. out indicates that the edges point from the parent to the children, in indicates that they point from the children to their parents, while undirected creates an undirected graph.

...

Passed to make_tree.

Value

An igraph graph

See Also

Examples

make_tree(10, 2)
make_tree(10, 3, mode = "undirected")

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

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