Learn R Programming

tnet (version 3.0.16)

shrink_to_weighted_network: 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): 1 2 1 2 1 2 1 2 1 3 1 3

Value

Returns a weighted one-mode network, e.g., 1 2 4 1 3 2

References

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

Examples

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab