inducedSubgraphByPkgs {BiocPkgTools} | R Documentation

## Return a minimal subgraph based on package name(s)

### Description

Find the subgraph induced by including specific packages. The induced subgraph is the graph that includes the named packages and all edges connecting them. This is useful for a developer, for example, to examine her packages and their intervening dependencies.

### Usage

    inducedSubgraphByPkgs(g, pkgs, pkg_color = "red")

### Arguments

`g` | an igraph graph, typically created by `buildPkgDependencyIgraph`
`pkgs` | character() vector of packages to include. Package names not included in the graph are ignored.
`pkg_color` | character(1) giving color of named packages. Other packages in the graph that fall in connecting paths will be colored as the igraph default.

### Examples

    library(igraph)
    g = buildPkgDependencyIgraph(buildPkgDependencyDataFrame())
    g2 = inducedSubgraphByPkgs(g, pkgs=c('GenomicFeatures',
    'TCGAbiolinksGUI', 'BiocGenerics', 'org.Hs.eg.db', 'minfi', 'limma'))
    g2
    V(g2)

    plot(g2)

[Package BiocPkgTools version 1.10.2 Index]