is.adjacent {network} | R Documentation |
is.adjacent
returns TRUE
iff vi
is adjacent to vj
in x
. Missing edges may be omitted or not, as per na.omit
.
is.adjacent(x, vi, vj, na.omit = TRUE)
x |
an object of class network |
vi |
a vertex ID |
vj |
a second vertex ID |
na.omit |
logical; should missing edges count when assessing adjacency? |
Vertex v is said to be adjacent to vertex v' within directed network G iff there exists some edge whose tail set contains v and whose head set contains v'. In the undirected case, head and tail sets are exchangeable, and thus v is adjacent to v' if there exists an edge such that v belongs to one endpoint set and v' belongs to the other. (In dyadic graphs, these sets are of cardinality 1, but this may not be the case where hyperedges are admitted.)
Adjacency can also be determined via the extraction/replacement operators. See the associated man page for details.
A logical, giving the status of the (i,j) edge
Carter T. Butts buttsc@uci.edu
Wasserman, S. and Faust, K. 1994. Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.
get.neighborhood
, network.extraction
#Create a very simple graph g<-network.initialize(3) add.edge(g,1,2) is.adjacent(g,1,2) #TRUE is.adjacent(g,2,1) #FALSE g[1,2]==1 #TRUE g[2,1]==1 #FALSE