cograph-package: cograph: Analysis and Visualization of Complex Networks

cograph-packageR Documentation

cograph: Analysis and Visualization of Complex Networks

Description

cograph analyses and plots social, transition and complex networks. It accepts adjacency matrices, edge lists, igraph, statnet network, qgraph and tna objects without conversion. It plots them with base R (splot) or grid graphics (soplot), reshapes them with a family of wrangling verbs (network_wrangling), and returns most of its analyses as tidy data frames.

Analysis functions

  • centrality: node centrality measures, one column per measure (see list_centralities)

  • network_summary: network-level statistics, one row per network

  • communities: community detection, one row per node

  • motifs and subgraphs: triad census and motif instances with significance tests

  • robustness and vulnerability: network robustness under node or edge removal

  • disparity_filter: backbone extraction

  • summarize_clusters and supra_adjacency: multi-cluster and multilayer networks

Plotting functions

  • splot: Plot a network with base R graphics

  • soplot: Plot a network with grid graphics

  • plot_tna, tplot: TNA-style plots with qgraph-compatible arguments

  • cograph: Create a network object for the builder functions

  • sn_layout: Apply layout algorithms

  • sn_nodes: Customize node aesthetics

  • sn_edges: Customize edge aesthetics

  • sn_theme: Apply visual themes

  • sn_render: Render to device

  • sn_ggplot: Convert to ggplot2 object

Layouts

Built-in layouts include the following; list_layouts lists every registered name:

  • circle, oval: Nodes arranged on a circle or ellipse

  • spring: Fruchterman-Reingold force-directed layout

  • gephi_fr: Gephi-style Fruchterman-Reingold layout

  • groups: Group-based circular layout

  • target: levels by graph distance from a focal node

  • saqr: rows of a transition flow between Start and End nodes

  • grid, star, bipartite, random

  • custom: User-provided coordinates

Themes

Built-in themes include:

  • classic: Traditional network visualization style

  • colorblind: Accessible color scheme

  • gray: Grayscale theme

  • dark: Dark background theme

  • minimal: Clean, minimal style

  • viridis: Viridis-based color theme

  • nature: Nature-inspired color theme

Weight conventions

In the analytic functions an edge weight is a strength. A higher weight means a stronger connection, such as a larger transition probability or a stronger correlation. This follows the convention of qgraph and tna.

Path-based measures such as betweenness, closeness, harmonic centrality and eccentricity can convert weights to distances as 1 / weight^alpha. The invert_weights argument of centrality controls this conversion. Its default is TRUE for tna objects and FALSE for other inputs, which matches igraph and sna. The alpha argument (default 1) sets the exponent.

Measures that do not use paths, such as degree, strength, eigenvector centrality, PageRank and transitivity, use the weights as given. Functions with a weights argument, such as shortest_paths, compute unweighted results when weights = NA. Individual help pages document exceptions.

Author(s)

Maintainer: Sonsoles López-Pernas sonsoles.lopez@uef.fi [copyright holder]

Authors:

  • Mohammed Saqr [copyright holder]

See Also

Useful links:


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