rmSelfLoops: Remove self-loops in a graph

Description Usage Arguments Value Author(s) Examples

View source: R/Graph.R

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)

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: RBGL
$a
[1] "b" "e"

$b
[1] "c" "a"

$c
[1] "d" "b"

$d
[1] "e" "c"

$e
[1] "e" "d" "a"

$a
[1] "b" "e"

$b
[1] "c" "a"

$c
[1] "d" "b"

$d
[1] "e" "c"

$e
[1] "d" "a"

BioNet documentation built on Nov. 8, 2020, 5:48 p.m.