Learn R Programming

HEMDAG (version 2.1.3)

do.subgraph: Build subgraph

Description

This function returns a subgraph with only the supplied nodes and any edges between them

Usage

do.subgraph(nd, g, edgemode = "directed")

Arguments

nd

a vector with the nodes for which the subgraph must be built

g

a graph of class graphNEL. It represents the hierarchy of the classes

edgemode

can be "directed" or "undirected"

Value

a subgraph with only the supplied nodes

Examples

Run this code
# NOT RUN {
data(graph);
anc <- build.ancestors(g);
nd <- anc[["HP:0001371"]];
subg <- do.subgraph(nd, g, edgemode="directed");
# }

Run the code above in your browser using DataLab