Skip to contents

1 Introduction

cograph provides two functions for visualizing community structure and higher-order relationships in networks:

Both accept any network type: tna, matrix, igraph, or cograph_network.

We use a TNA model of collaborative group regulation throughout:

model <- tna(group_regulation)

2 overlay_communities()

2.1 Method Name

The simplest way: pass an igraph community detection method name. Partial matching and flexible naming are supported.

overlay_communities(model, "fast_greedy")

Any igraph cluster_* method works: "walktrap", "louvain", "fast_greedy", "leading_eigen", "infomap", "leiden", "label_prop", "edge_betweenness", "spinglass", "optimal", "fluid_communities". You can use the full igraph name ("cluster_walktrap"), the short name ("walktrap"), or a partial match ("leading_eige"). Directed graphs are automatically converted to undirected for detection.

overlay_communities(model, "louvain")

2.2 Named List

Define communities manually with a named list:

overlay_communities(model, list(
  Regulatory = c("plan", "monitor", "adapt"),
  Social     = c("cohesion", "emotion", "consensus"),
  Task       = c("discuss", "synthesis", "coregulate")
))