edge.duplicates: Find and Remove Edge Loops and Duplicates

Description Usage Arguments Details Value Author(s) References Examples

View source: R/linkcomm_main.R

Description

This function finds and removes loops, edge duplicates, and bi-directional edges.

Usage

1
edge.duplicates(network, verbose = TRUE)

Arguments

network

An edge list, which is either a data frame or a character or integer matrix with two columns.

verbose

Logical, whether to display the progress of the function on the screen. Defaults to TRUE.

Details

This function removes loops, duplicate and bi-directional edges; the edges that occur closer to the end of the edge list will be removed.

Value

A list with the following elements: edges - a character matrix of the edges in the network with any loops or duplicate edges removed; inds - an integer vector of the edge indices of any loop or duplicate edges in the original network.

Author(s)

Alex T. Kalinka alex.t.kalinka@gmail.com

References

Kalinka, A.T. and Tomancak, P. (2011). linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics 27, 2011-2012.

Examples

1
2
3
## Generate graph and remove loops and duplicate edges.
g <- swiss[,3:4]
g.dup <- edge.duplicates(g)

linkcomm documentation built on Feb. 4, 2021, 5:05 p.m.