-
Notifications
You must be signed in to change notification settings - Fork 4
/
11-fcns_selection.Rmd
209 lines (103 loc) · 7.14 KB
/
11-fcns_selection.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Functions: Selection {#fcns_selection}
## `select_nodes()`
<img src="diagrams/selection/select_nodes.svg">
<h4><em>Select nodes in a graph</em></h4>
<h5>DESCRIPTION</h5>
Select nodes from a graph object of class `dgr_graph`.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`conditions`** an option to use filtering conditions for the retrieval of nodes.
**`set_op`** the set operation to perform upon consecutive selections of graph nodes. This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
**`nodes`** an optional vector of node IDs for filtering the list of nodes present in the graph.
## `select_edges()`
<img src="diagrams/selection/select_edges.svg">
<h4><em>Select edges in a graph</em></h4>
<h5>DESCRIPTION</h5>
Select edges from a graph object of class `dgr_graph`.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`conditions`** an option to use filtering conditions for the retrieval of edges.
**`set_op`** the set operation to perform upon consecutive selections of graph nodes. This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
**`from`** an optional vector of node IDs from which the edge is outgoing for filtering the list of edges present in the graph.
**`to`** an optional vector of node IDs to which the edge is incoming for filtering the list of edges present in the graph.
## `select_last_nodes_created()`
<img src="diagrams/selection/select_last_nodes_created.svg">
<h4><em>Select the last set of nodes created in a graph</em></h4>
<h5>DESCRIPTION</h5>
Select the last nodes that were created in a graph object of class `dgr_graph`. This function should ideally be used just after creating the nodes to be selected.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
## `select_last_edges_created()`
<img src="diagrams/selection/select_last_edges_created.svg">
<h4><em>Select the last set of edges created in a graph</em></h4>
<h5>DESCRIPTION</h5>
Select the last edges that were created in a graph object of class `dgr_graph`. This function should ideally be used just after creating the edges to be selected.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
## `select_nodes_by_id()`
<img src="diagrams/selection/select_nodes_by_id.svg">
<h4><em>Select nodes in a graph by ID values</em></h4>
<h5>DESCRIPTION</h5>
Select nodes in a graph object of class `dgr_graph` by their node ID values. If nodes have IDs that are monotonically increasing integer values, then numeric ranges can be used for the selection.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`nodes`** a vector of node IDs for the selection of nodes present in the graph.
**`set_op`** the set operation to perform upon consecutive selections of graph nodes. This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
## `select_nodes_in_neighborhood()`
<img src="diagrams/selection/select_nodes_in_neighborhood.svg">
<h4><em>Select nodes based on a walk distance from a specified node</em></h4>
<h5>DESCRIPTION</h5>
Select those nodes in the neighborhood of nodes connected a specified distance from an initial node.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`node`** the node from which the traversal will originate.
**`distance`** the maximum number of steps from the `node` for inclusion in the selection.
**`set_op`** the set operation to perform upon consecutive selections of graph nodes. This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
## `select_nodes_by_degree()`
<img src="diagrams/selection/select_nodes_by_degree.svg">
<h4><em>Select nodes in the graph based on their degree values</em></h4>
<h5>DESCRIPTION</h5>
Using a graph object of class `dgr_graph`, create a selection of nodes that have certain degree values.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`expressions`** one or more expressions for filtering of nodes by degree values. Use a combination of a degree type (`deg` for total degree, `indeg` for in-degree, and `outdeg` for out-degree) with a comparison operator and values for comparison (e.g., use \code{"deg >= 2"} to select nodes with a degree greater than or equal to 2).
**`set_op`** the set operation to perform upon consecutive selections of graph nodes. This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
## `select_edges_by_edge_id()`
<img src="diagrams/selection/select_edges_by_edge_id.svg">
<h4><em>Select edges in a graph using edge ID values</em></h4>
<h5>DESCRIPTION</h5>
Select edges in a graph object of class `dgr_graph` using edge ID values.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`edges`** a vector of edge IDs for the selection of edges present in the graph.
**`set_op`** the set operation to perform upon consecutive selections of graph edges. This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
## `select_edges_by_node_id()`
<img src="diagrams/selection/select_edges_by_node_id.svg">
<h4><em>Select edges in a graph using node ID values</em></h4>
<h5>DESCRIPTION</h5>
Select edges in a graph object of class `dgr_graph` using node ID values. All edges associated with the provided nodes will be included in the selection.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
**`nodes`** a vector of node IDs for the selection of edges present in the graph.
**`set_op`** the set operation to perform upon consecutive selections of graph edges This can either be as a `union` (the default), as an intersection of selections with `intersect`, or, as a `difference` on the previous selection, if it exists.
## `invert_selection()`
<img src="diagrams/selection/invert_selection.svg">
<h4><em>Invert selection of nodes or edges in a graph</em></h4>
<h5>DESCRIPTION</h5>
Modify the selection of nodes or edges within a graph object such that all nodes or edges previously unselected will now be selected and vice versa.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
## `clear_selection()`
<img src="diagrams/selection/clear_selection.svg">
<h4><em>Clear a selection of nodes or edges in a graph</em></h4>
<h5>DESCRIPTION</h5>
Clear the selection of nodes or edges within a graph object.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.
## `get_selection()`
<img src="diagrams/selection/get_selection.svg">
<h4><em>Get the current selection available in a graph object</em></h4>
<h5>DESCRIPTION</h5>
Get the current selection of nodes or edges from a graph object of class `dgr_graph`.
<h5>PARAMETERS</h5>
**`graph`** a graph object of class `dgr_graph`.