A generic function to compute the within-class neighbors of a graph.
Value
An object representing the within-class neighbors of the input graph, the structure of which depends on the input object's class.
Examples
labs <- factor(c("a","a","b"))
cg <- class_graph(labs)
ng <- neighbor_graph(diag(3))
within_class_neighbors(cg, ng)
#> $G
#> IGRAPH c6c84d6 U--- 3 0 --
#> + edges from c6c84d6:
#>
#> $params
#> list()
#>
#> attr(,"class")
#> [1] "neighbor_graph"