getFactions: getFactions function

Description Usage Arguments Value Examples

View source: R/getFactions.R

Description

getFactions is a support function for inferring faction leaders and their members as well as a faction size ratio of each faction. Leaders are nodes that have zero outgoing degree. Members of leader A's faction are nodes that have some directed path to A in a following network.

Usage

1
getFactions(adjMat)

Arguments

adjMat

is an adjacency matrix of a following network.

Value

This function returns a list of leader IDs, a list of faction members, and network densities of factions.

leaders

is a list of faction leader IDs

factionMembers

is a list of members of factions where factionMembers[[i]] is a list of faction members of a leader leaders[i]'s faction.

factionSizeRatio

is a vector of faction size ratio of each faction. factionSizeRatio[i] is a number of edges within a leader leaders[i]'s faction divided by N choose 2 where N is a number of all nodes.

Examples

1
2
3
4
5
6
7
8
# Given an example of adjacency matrix
A<-matrix(FALSE,5,5)
A[2,1]<-TRUE
A[c(3,4),2]<-TRUE
A[5,3]<-TRUE
# Get faction leaders and their members as well as a network density of each faction.

out<-getFactions(adjMat=A)

mFLICA documentation built on Jan. 24, 2022, 5:09 p.m.