is.adjacent {network}R Documentation

Determine Whether Two Vertices Are Adjacent

Description

is.adjacent returns TRUE iff vi is adjacent to vj in x. Missing edges may be omitted or not, as per na.omit.

Usage

is.adjacent(x, vi, vj, na.omit = TRUE)

Arguments

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?

Details

Value

A logical, giving the status of the (i,j) edge

Author(s)

Carter T. Butts buttsc@uci.edu

References

Wasserman, S. and Faust, K. 1994. Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.

See Also

get.neighborhood

Examples

#Create a very simple graph
g<-network.initialize(3)
g<-add.edge(g,1,2)
is.adjacent(g,1,2)  #TRUE
is.adjacent(g,2,1)  #FALSE

[Package network version 0.5-4 Index]