Learn R Programming

linkcomm (version 1.0-11)

edge.duplicates: Find and Remove Edge Loops and Duplicates

Description

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

Usage

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.

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.

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.

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

Run this code
# NOT RUN {
## Generate graph and remove loops and duplicate edges.
g <- swiss[,3:4]
g.dup <- edge.duplicates(g)

# }

Run the code above in your browser using DataLab