R/neighbor_nms.R

Defines functions neighbor_nms

Documented in neighbor_nms

#' Get names of nodes' neighbors
#'
#' Get node names of nodes' direct neighbors
#'
#' @param nodes Node names in the graph
#' @inheritParams graph2kernel

neighbor_nms <- function(gr, nodes){
  return(igraph::V(gr)$name[unlist(igraph::ego(gr, order=1, match(nodes, igraph::V(gr)$name)))])
}
jdreyf/PANTS documentation built on July 18, 2019, 10:12 a.m.