Remove self-loops in a graph

Share:

Description

The function removes self-loops, edges that start and end in the same node, from the network.

Usage

1
rmSelfLoops(network)

Arguments

network

A graph object, either in graphNEL or igraph format.

Value

The graph with the removed edges.

Author(s)

Marcus Dittrich

Examples

1
2
3
4
graph <- makeNetwork(c("a","b","c","d","e","a"), c("b","c","d","e","e","e"))
graph2 <- rmSelfLoops(graph)
edges(graph)
edges(graph2)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.