shrink_to_weighted_network {tnet} | R Documentation |
This function creates a weighted edgelist from a list of edges where a duplicate means an increase in the weight.
shrink_to_weighted_network(net)
net |
can use both undirected and directed edgelist in the following format (sender.id receiver.id weight): 1 2 1 2 1 2 1 2 1 3 1 3 |
Returns a weighted edgelist
version 1.0.0
Tore Opsahl; http://toreopsahl.com
http://toreopsahl.com/2008/11/28/network-weighted-network/
## Load sample data sample <- rbind( c(1,2), c(1,2), c(1,2), c(1,2), c(1,3), c(1,3), c(2,1), c(2,1), c(2,1), c(2,1), c(2,3), c(2,3), c(2,3), c(2,3), c(2,4), c(2,5), c(2,5), c(3,1), c(3,1), c(3,2), c(3,2), c(3,2), c(3,2), c(4,2), c(5,2), c(5,2), c(5,6), c(6,5)) ## Run the programme shrink_to_weighted_network(sample)