shrink: Shrink a 2-mode-network

Description Usage Arguments Value Author(s) Examples

Description

Shrink a 2-mode-network into a 1-mode-network by omitting one node set (S) and connecting two nodes of the other set (R) if they were both formally connected a certain nodes of S.

Usage

1
shrink(network,by=c("row","column"),keep=NULL,values=c("sum","min","max"))

Arguments

network

An adjacency matrix representing a 2-mode-network (bipartite network). A 2-mode-network has two sets of nodes where each node can only be connected to nodes of the other set.

by

.

keep

A numerical vector containing the node numbers to be kept (node numbers of one node set).

values

How should line values be aggregated. sum takes the sum of the line values that formally connected the omitted node with its two adjacent nodes. min takes the minimum and max takes the maximum.

Value

A matrix of dimension length(keep) x length(keep) containing the new connections for the remaining node set.

Author(s)

Angela Bohn angela.bohn at gmail.com

Examples

1
2
3
twomode <- matrix(c(0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,1),ncol=4)
rownames(twomode) <- colnames(twomode) <- c("S1","R1","S2","R2")
onemode <- shrink(twomode,by="row",keep=c(1,3),values="sum")

snatm documentation built on May 2, 2019, 5:01 p.m.

Related to shrink in snatm...