shrink_to_weighted_network {tnet} | R Documentation |
Shrink a repetative edgelist into a weighted
Description
This function creates a weighted edgelist from a list of edges where a duplicate means an increase in the weight.
Usage
shrink_to_weighted_network(net)
Arguments
net |
can use both undirected and directed edgelist in the following format (sender.id receiver.id): |
Value
Returns a weighted one-mode network, e.g.,
1 2 4
1 3 2
Note
version 1.0.0
Author(s)
Tore Opsahl; http://toreopsahl.com
References
http://toreopsahl.com/2008/11/28/network-weighted-network/
Examples
## 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)
[Package tnet version 3.0.16 Index]