shrink_to_weighted_network

This function creates a weighted edgelist from a list of edges where a duplicate means an increase in the weight.

The function has only one option: edgelist

Example: Sample data

## Load tnet
library(tnet) 
## Sample data
Imagesample <- 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 programme
shrink_to_weighted_network(sample)
   i j w
1  1 2 4
2  1 3 2
3  2 1 4
4  2 3 4
5  2 4 1
6  2 5 2
7  3 1 2
8  3 2 4
9  4 2 1
10 5 2 2
11 5 6 1
12 6 5 1

 

Last Updated ( Friday, 19 June 2009 )