Get non-neighbors for neighbor_graph object
Source:R/neighbor_graph.R
non_neighbors.neighbor_graph.RdRetrieve the non-neighboring nodes of a given node in a neighbor_graph object.
Usage
# S3 method for class 'neighbor_graph'
non_neighbors(x, i, ...)Value
A numeric vector of node indices that are not neighbors of the given node (excluding the node itself).
Examples
adj_matrix <- Matrix::Matrix(c(0, 1, 1, 0, 1, 0, 1, 0, 0),
nrow = 3, byrow = TRUE, sparse = TRUE)
ng <- neighbor_graph(adj_matrix)