adj | R Documentation |
Generic function for finding adjacent vertices based on any kind of edge.
adj(graph, v, etype, dir = 0, inclusive = TRUE, sort = 1, force = FALSE)
adjacent(graph, v1, v2, etype, dir = 0)
graph |
an object of class |
v |
vertices to find adjacencies |
etype |
edge types to consider; defaults to all |
dir |
for directed edges, indicates which direction to search in: 1: along direction, -1: against direction, 0: both directions. |
inclusive |
logical indicating whether elements of |
sort |
integer: 1 for unique but unsorted, 2 for sorted (0 for possibly repeated and unsorted). If edges are stored as a matrix then output will always be unique and sorted. |
force |
logical - should invalid |
v1 , v2 |
vertices between which to test for adjacency |
The argument directed
is recycled for multiple edge types, but
has no effect for edges without a specified direction. If any v
is
not a vertex of graph
, an error is returned, unless force=TRUE
.
The function adjacent
tests for a particular adjacency between
two vertices.
adjacent()
: Test for adjacency
grp
for vertices joined by paths, groups
for partitions of vertices by adjacency type.
adj(gr1, v=1, etype="directed")
adj(gr1, v=1, etype="directed", dir=-1)
adjacent(gr1, 1, 3, etype="directed", dir=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.