layout_groups: Group-based Layout

View source: R/layout-groups.R

layout_groupsR Documentation

Group-based Layout

Description

Places the nodes by group membership. The group centers lie on a circle around (0.5, 0.5), starting at the top and proceeding counterclockwise in the order of the group levels. A single group is centered at (0.5, 0.5). The nodes of each group lie on a circle around their group center, and a group with one node is placed at its center.

Usage

layout_groups(
  network,
  groups,
  group_positions = NULL,
  inner_radius = 0.15,
  outer_radius = 0.35
)

Arguments

network

A CographNetwork or cograph_network object.

groups

Vector of group memberships, one per node (numeric, character, or factor). A length different from the number of nodes raises an error.

group_positions

Optional list or data frame with columns x and y giving the group centers, one row per group level.

inner_radius

Radius of the circle of nodes within each group. Default 0.15.

outer_radius

Radius of the circle of group centers. Default 0.35.

Value

A data frame with columns x and y and one row per node, in node order.

Examples

layout_groups(CographNetwork$new(regulation_net),
  groups = rep(c("A", "B"), each = 5))


cograph documentation built on Nov. 19, 2026, 5:07 p.m.