subgraph: Subgraph

Description Usage Arguments Value Examples

View source: R/helper_decomp_graphs.R

Description

Construct a subgraph with a given set of nodes removed

Usage

1
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

1
2
3
4
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 May 31, 2021, 9:10 a.m.