Description Usage Arguments Value Author(s) Examples

The function creates a subgraph with the nodes given in the nodeList or for these nodes including their direct neighbors.

1 | ```
subNetwork(nodeList, network, neighbors=c("none", "first"))
``` |

`nodeList` |
Character vector of nodes, contained in the subgraph. |

`network` |
Graph that is used for subgraph extraction. |

`neighbors` |
Neighborhood, that is chosen for the subgraph extraction. "none" are only the selected nodes, "first" includes the direct neighbors of the selected nodes. |

A graph object.

Marcus Dittrich

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
library(igraph)
el <- cbind(c("a", "b", "c", "d", "e", "f", "d"), c("b", "c", "d", "e", "f", "a", "b"))
graph <- graph.edgelist(el, directed=TRUE)
node.list <- c("a", "b", "c")
graph2 <- subNetwork(nodeList=node.list, network=graph)
## Not run: par(mfrow=c(1,2));
plotModule(graph);
plotModule(graph2)
## End(Not run)
# or in graphNEL format:
graph3 <- igraph.to.graphNEL(graph)
graph4 <- subNetwork(nodeList=node.list, network=graph3)
graph3
graph4
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.