Some functions in the 'tidygraph' package require the index of a
node. This function evalutes an input expression in the
dplyr::filter()
function in the node tibble of a tidygraph object
and returns the indices of the nodes that pass.
get_node_index(gr, expr)
gr | a tidygraph |
---|---|
expr | an expression to be quoted and evaluated in the context of the node tibble of the tidygraph object |
#> [1] 2#> [1] 2 3 4#> [1] 1 2 3