node_types: Querying node types

Description Usage Arguments Value Functions Examples

Description

These functions all lets the user query whether each node is of a certain type. All of the functions returns a logical vector indicating whether the node is of the type in question. Do note that the types are not mutually exclusive and that nodes can thus be of multiple types.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
node_is_cut()

node_is_root()

node_is_leaf()

node_is_sink()

node_is_source()

node_is_isolated()

node_is_universal(mode = "out")

node_is_simplical(mode = "out")

node_is_center(mode = "out")

node_is_adjacent(to, mode = "all", include_to = TRUE)

node_is_keyplayer(k, p = 0, tol = 1e-04, maxsec = 120,
  roundsec = 30)

Arguments

mode

The way edges should be followed in the case of directed graphs.

to

The nodes to test for adjacency to

include_to

Should the nodes in to be marked as adjacent as well

k

The number of keyplayers to identify

p

The probability to accept a lesser state

tol

Optimisation tolerance, below which the optimisation will stop

maxsec

The total computation budget for the optimization, in seconds

roundsec

Number of seconds in between synchronizing workers' answer

Value

A logical vector of the same length as the number of nodes in the graph.

Functions

Examples

1
2
3
# Find the root and leafs in a tree
create_tree(40, 2) %>%
  mutate(root = node_is_root(), leaf = node_is_leaf())

tidygraph documentation built on May 2, 2019, 8:32 a.m.