subgraph {ess}R 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))

[Package ess version 1.1.2 Index]