Learn R Programming

BioNet (version 1.26.1)

rmSelfLoops: Remove self-loops in a graph

Description

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

Usage

rmSelfLoops(network)

Arguments

network
A graph object, either in graphNEL or igraph format.

Value

The graph with the removed edges.

Examples

Run this code
graph <- makeNetwork(c("a","b","c","d","e","a"), c("b","c","d","e","e","e"))
graph2 <- rmSelfLoops(graph)
edges(graph)
edges(graph2)

Run the code above in your browser using DataLab