get.edges: Retrieve Edges or Edge IDs Associated with a Given Vertex
Description
get.edges retrieves a list of edges incident on a given vertex; get.edgeIDs returns the internal identifiers for those edges, instead. Both allow edges to be selected based on vertex neighborhood and (optionally) an additional endpoint.
an indicator for whether we are interested in in-edges, out-edges, or both (relative to v)
na.omit
logical; should we omit missing edges?
Value
For get.edges, a list of edges. For get.edgeIDs, a vector of edge ID numbers.
Details
By default, get.edges returns all out-, in-, or out- and in-edges containing v. (get.edgeIDs is identical, save in its return value.) Specifying a vertex in alter causes these edges to be further selected such that alter must also belong to the edge -- this can be used to extract edges between two particular vertices. Omission of missing edges is accomplished via na.omit.
References
Butts, C.T. 2002. ``Memory Structures for Relational Data in R: Classes and Interfaces'' Working Paper.
#Create a network with three edgesm<-matrix(0,3,3)
m[1,2]<-1; m[2,3]<-1; m[3,1]<-1g<-network(m)
get.edges(g,1,neighborhood="out")
get.edgeIDs(g,1,neighborhood="in")