Learn R Programming

tnet (version 3.0.1)

symmetrise: Symmetrise

Description

The symmetrise function creates an undirected edgelist from a directed edgelist.

Usage

symmetrise(net, method="MAX")

Arguments

net
A directed weighted edgelist
method
the method used to decide the weight of the undirected edge. It can be: "MAX" sets the weight to the maximum of the weight(s) of the arc(s) "MIN" sets the weight to the minimumof the weight(s) of the arc(s) "AMEAN" sets the weight to the average

Value

  • Returns the undirected edgelist.

References

http://toreopsahl.com/2008/11/28/network-weighted-network/

Examples

Run this code
## Load sample data
sample <- rbind(
c(1,2,2),
c(1,3,2),
c(2,1,4),
c(2,3,4),
c(2,4,1),
c(2,5,2),
c(3,1,2),
c(3,2,4),
c(5,2,2),
c(5,6,1))

## Run the programme
symmetrise(sample, method="MAX")

Run the code above in your browser using DataLab