bridgeGroup: Get new groups that bridge nodes are in a single group.

View source: R/bridgeGroup.R

bridgeGroupR Documentation

Get new groups that bridge nodes are in a single group.

Description

Get new groups that bridge nodes are in a single group.

Usage

bridgeGroup(bridge, groups, labels = NULL, n = 1, by_group = TRUE)

Arguments

bridge

The output of quickNet::Bridge.

groups

The original groups or communities parameter used. if groups is a list, the name of each group should not be end with numbers.

labels

If there are labels for each node, please provide.

n

The number of nodes to recode by bridge strength, n nodes with highest bridge strength will be recoded as bridge node.

by_group

Whether the node recoding procedure should be conducted by groups. If TRUE, the function will recode n nodes with highest bridge strength in each original group. If FALSE,the function will recode n nodes with highest bridge strength in all nodes.

Value

A factor, can be used as new groups parameter in quickNet::quickNet

Examples

data('mtcars')
groups = list(A = 1:5, B = 6:11)
net_G <- quickNet(mtcars, groups = groups)
Bridge <- Bridge(net_G,communities = groups)
new_groups <- bridgeGroup(Bridge, groups, n = 1, by_group = TRUE)
net_G <- quickNet(mtcars, groups = new_groups)


LeiGuo0812/quickNet documentation built on May 1, 2024, 10:42 p.m.