Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_non_nbrs

Get non-neighbors of a node in a graph


Description

Get the set of all nodes not neighboring a single graph node.

Usage

get_non_nbrs(graph, node)

Arguments

graph

A graph object of class dgr_graph.

node

A single-length vector containing a node ID value.

Value

A vector of node ID values.

Examples

# Create a simple, directed graph with 5
# nodes and 4 edges
graph <-
  create_graph() %>%
  add_path(n = 5)

# Find all non-neighbors of node `2`
graph %>% get_non_nbrs(node = 2)

DiagrammeR

Graph/Network Visualization

v1.0.6.1
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.