Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

inEdges

Generic Method inEdges


Description

Returns a list of all incoming edges for the specified nodes.

Usage

inEdges(node, object)

Arguments

node

character vector of node names

object

a graph object

Details

If no node argument is specified, inEdges returns the incoming edges for all nodes in the graph.

For an undirected graph, inEdges returns all edges for the specified nodes.

Value

A list with length matching the length of node. If node was missing, a list containing an element for each node in the graph.

Each list element contains a character vector of node names giving the nodes that have outgoing edges to the node given by the name of the list element.

Author(s)

R. Gentleman

See Also

Examples

V <- LETTERS[1:4]
  edL3 <- vector("list", length=4)
  for(i in 1:4)
    edL3[[i]] <- list(edges=(i%%4)+1, weights=i)
  names(edL3) <- V
  gR3 <- graphNEL(nodes=V, edgeL=edL3, "directed")
  inEdges(c("A", "B"), gR3)

graph

graph: A package to handle graph data structures

v1.68.0
Artistic-2.0
Authors
R. Gentleman, Elizabeth Whalen, W. Huber, S. Falcon
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.