
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 = FALSE)
A logical, giving the status of the (i,j) edge
an object of class network
a vertex ID
a second vertex ID
logical; should missing edges be ignored when assessing adjacency?
Carter T. Butts buttsc@uci.edu
Vertex
If an edge which would make na
attribute), then the behavior of
is.adjacent
depends upon na.omit
. If na.omit==FALSE
(the default), then the return value is considered to be NA
unless
there is also another edge from na.omit==TRUE
, on the other hand the missing edge is simply
disregarded in assessing adjacency (i.e., it effectively treated as not
present). It is important not to confuse “not present” with
“missing” in this context: the former indicates that the edge in
question does not belong to the network, while the latter indicates that the
state of the corresponding edge is regarded as unknown. By default, all
edge states are assumed “known” unless otherwise indicated (by
setting the edge's na
attribute to TRUE
; see
attribute.methods
).
Adjacency can also be determined via the extraction/replacement operators. See the associated man page for details.
Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). tools:::Rd_expr_doi("10.18637/jss.v024.i02")
Wasserman, S. and Faust, K. 1994. Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.
get.neighborhood
, network.extraction
,
attribute.methods
#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
Run the code above in your browser using DataLab