R/filterGraph.R
filterGraph.RdCut the input igraph object by the distances from the root.
A igraph object after filtering
library(igraph)
#>
#> Attaching package: ‘igraph’
#> The following objects are masked from ‘package:stats’:
#>
#> decompose, spectrum
#> The following object is masked from ‘package:base’:
#>
#> union
g_gnp <- sample_gnp(n = 25, p = 0.05)
filterGraph(g_gnp, leaveTerms = V(g_gnp), cutoff = 2)
#> ancestor offspring
#> 1 1 22
#> 2 1 25
#> 3 5 25
#> 4
#> 5 2 3
#> 6
#> 7 8 19
#> 8
#> 9 13 16
#> 10 16 18
#> 11