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

clearNode

clearNode


Description

This function removes all edges to or from the specified node in the graph.

Usage

clearNode(node, object)

Arguments

node

a node

object

a graph

Details

All edges to and from node are removed. node can be a vector.

Value

A new instance of the graph with all edges to and from the specified node(s) removed.

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")
 g4 <- clearNode("A", 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.