degree_tm {tnet} | R Documentation |
This function calculates two degree measures: the number of contacts that a node is connected to, and the sum of weights on ties originating from a node (strength).
degree_tm(net,measure=c("degree","output"))
net |
A two-mode network |
measure |
specifies which measures should be calculated |
Returns a data.frame with two or three columns: the first column contains the nodes' ids, and the remaining columns contain the scores of the measures specified in the measure-parameter.
version 1.0.0
Tore Opsahl; http://toreopsahl.com
http://toreopsahl.com/blog/
## Load sample data
network <- cbind(
i=c(1,1,2,2,2,3,3,4,5,5,6),
p=c(1,2,1,3,4,2,3,4,3,5,5),
w=c(3,5,6,1,2,6,2,1,3,1,2))
## Run the programme
degree_tm(network)