grow_nodes {rsemmed} | R Documentation

## Obtain immediate neighbors

### Description

Grow a set of nodes into its first order neighborhood.

### Usage

    grow_nodes(graph, nodes)

### Arguments

`graph` | The SemMed graph
`nodes` | A vertex sequence (`igraph.vs`) of nodes to be grown

### Details

`grow_nodes` obtains the set of immediate neighbors of the supplied nodes using `igraph::ego`. Unlike `ego`, `grow_nodes` flattens the result from a list to an ordinary vertex sequence and removes the original search nodes.

### Value

A vertex sequence of nodes in the neighborhood (not including the original nodes)

### See Also

`find_nodes` for filtering out irrelevant nodes from this set.

### Examples

    data(g_mini)

    node_cortisol <- find_nodes(g_mini, name = "hypercortisolemia")
    nbrs <- grow_nodes(g_mini, node_cortisol)

[Package rsemmed version 1.0.0 Index]