Learn R Programming

network (version 0.5-4)

is.adjacent: 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?

Value

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

References

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

See Also

get.neighborhood

Examples

Run this code
#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

Run the code above in your browser using DataLab