neighborhood: Get the neighborhood of a node in a graph

View source: R/abstract-graph.R

neighborhoodR Documentation

Get the neighborhood of a node in a graph

Description

That is, find all nodes connected to node by an outgoing edge. This function is memorized to avoid making repeated API queries.

Usage

neighborhood(graph, node)

Arguments

graph

A graph object.

node

The name of a single node in graph as a character vector.

Value

A character vector of all nodes in graph connected such that there is an outgoing edge for node to those nodes. This should never be empty, as neighborhood() should not be called on nodes that fail check(), and check() enforces that nodes have out-degree of at least one. It is critical node names are duplicated in the output recommend calling unique() if there is any potential for for that to occur.


RoheLab/aPPR documentation built on July 1, 2024, 1:57 p.m.