removeSelfLoops {RBGL} | R Documentation

## remove self loops in a graph

### Description

remove self loops in a graph

### Usage

    removeSelfLoops(g)

### Arguments

`g` | one instance of the `graph` class

### Details

If a given graph contains self-loop(s), `removeSelfLoops` removes them. This is for those functions that cannot handle graphs with self-loops.

### Value

A new graph without self loops.

### Author(s)

Li Long <li.long@isb-sib.ch>

### Examples

    con <- file(system.file("XML/dijkex.gxl",package="RBGL"))
    g1 <- fromGXL(con)
    close(con)

    g2 <- ugraph(g1)
    removeSelfLoops(g2)

[Package RBGL version 1.18.0 Index]