Within-Class Neighbors for class_graph Objects
Source:R/class_graph.R
within_class_neighbors.class_graph.RdCompute the within-class neighbors of a class_graph object.
Usage
# S3 method for class 'class_graph'
within_class_neighbors(x, ng, ...)Examples
labs <- factor(c("a","a","b"))
cg <- class_graph(labs)
ng <- neighbor_graph(matrix(c(0,1,0,1,0,0,0,0,0),3))
within_class_neighbors(cg, ng)
#> $G
#> IGRAPH 5f87f12 U-W- 3 1 --
#> + attr: weight (e/n)
#> + edge from 5f87f12:
#> [1] 1--2
#>
#> $params
#> list()
#>
#> attr(,"class")
#> [1] "neighbor_graph"