subset_graph: Subset graph

View source: R/subset_graph.R

subset_graphR Documentation

Subset graph

Description

Subset a graph by nodes to include or exclude. Automatically omits include/exclude nodes that don't exist in the graph to avoid errors.

Usage

subset_graph(g, include = NULL, exclude = NULL, verbose = TRUE)

Arguments

g

A graph of class igraph. Warning: Large graphs may be slow to interact with.

include

Names of nodes to include.

exclude

Names of nodes to exclude.

verbose

Print messages.

Value

Subgraph.

Examples

dgc_out <- dep_graph_create(pkg = "rworkflows",
                            method = "github",
                            node_size = "clones_uniques")
g <- dgc_out$graph
exclude <- grep("actions-marketplace-validations",
                names(igraph::V(g)),value = TRUE)
g2 <- subset_graph(g = g, exclude = exclude)

RajLabMSSM/echodeps documentation built on Oct. 31, 2023, 7:20 a.m.