subgraph: Subgraph

View source: R/helper_decomp_graphs.R

subgraphR Documentation

Subgraph

Description

Construct a subgraph with a given set of nodes removed

Usage

subgraph(x, g)

Arguments

x

Character vector of nodes

g

Adjacency list (named) or a adjacency matrix with dimnames given as the nodes

Value

An adjacency list or adjacency matrix.

Examples

adj <- list(a = c("b", "d"), b = c("a", "c", "d"), c = c("b", "d"), d = c("a", "c", "b"))
d <- data.frame(a = "", b = "", c ="", d = "") # Toy data so we can plot the graph
subgraph(c("c", "b"), adj)
subgraph(c("b", "d"), as_adj_mat(adj))

ess documentation built on Jan. 10, 2026, 5:06 p.m.