View source: R/helper_decomp_graphs.R
| subgraph | R Documentation |
Construct a subgraph with a given set of nodes removed
subgraph(x, g)
x |
Character vector of nodes |
g |
Adjacency list (named) or a adjacency matrix with dimnames given as the nodes |
An adjacency list or adjacency matrix.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.