grow_nodes: Obtain immediate neighbors

Description Usage Arguments Details Value See Also Examples

View source: R/grow.R

Description

Grow a set of nodes into its first order neighborhood.

Usage

1
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

1
2
3
4
data(g_mini)

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

rsemmed documentation built on Nov. 8, 2020, 5:32 p.m.