Create a Subgraph
Given a set of nodes and a graph this function creates and returns subgraph with only the supplied nodes and any edges between them.
subGraph(snodes, graph)
snodes |
A |
graph |
A graph object, it must inherit from the |
The returned subgraph is a copy of the graph. Implementations for
Implementations for graphNEL
, distGraph
and
clusterGraph
.
A graph of the same class as the graph
argument but with only
the supplied nodes.
R. Gentleman
set.seed(123) x <- rnorm(26) names(x) <- letters library(stats) d1 <- dist(x) g1 <- new("distGraph", Dist=d1) subGraph(letters[1:5], g1)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.